How to pass variables to a report in VBA

Hello,
I would like to run a report that gets the month and the year as a user variables.

I would like to have the report automatically get they year as this year and the month as last month.

Can you refer me to a way to do it?

thanks in advance for your help,
Eran.


eransh10 (BOB member since 2008-09-09)

Why do you not want to do this by using objects from your universe (or even variables in the report) that return these values rather than doing it programmatically?


clg :uk: (BOB member since 2009-09-23)

Let me explain further -
The report I’m using is getting the month and the year by a report variable from the user (not with a universe variable). I need the report to run every 1st of the month and run itself for shipments from last month.
Lets say it runs on Oct 1st 2009 - it would generate the report for Sep 2009.

That is what I want to achieve.


eransh10 (BOB member since 2008-09-09)

OK, I think I understand what you are trying to do.

You could create two universe objects
The first would give you the 1st day of the previous month
The second would give you the last day of the previous month

In the conditions of your report add the condition date between [start of month object] and [end of month object]

then schedule your report to run on the first of each month.

How does that sound?


clg :uk: (BOB member since 2009-09-23)

I have a report with two sections on it say A and B, the macro is used to generate PDFs for each value of A when B value (one value) is passed through the prompt. This is working fine but when I try to pass morethan one value through prompt (B) then it has to generate two PDFs.


For Example: "B" values are : 2002;2007 
                    "A" values are : 123;234;543;576 etc
 then the output I need is : 2002_123.pdf
                                        2007_123.pdf
                                        2002_234.pdf
                                        2007_234.pdf
                                        2002_543.pdf
                                        2007_576.pdf

but its not generating that way, its generating for “A” value 123 as 2002_123.pdf only when I open that pdf I can see 2007_123 details.

How to generate 2 seperate PDFs for “A” (123)? any thoughts appreciated.


Saikutty :india: (BOB member since 2005-07-28)