HOW TO USE Variables in Reports Property window.
Hi all, I want to how to use Vaibles in Reort which is available in Variables window tab in Reports Property If Provide some Example then its better to understand. Abhay Sawant
November 22nd, 2010 2:09am

Hi AbhaySawant, Report variables are calculated only once before the report is rendered to user, so you can use it to hold a value for time-dependent calculations. E.g. the data source table has a column representing each of the scheduled ship time of goods. Some goods have been shipped, and some will be shipped. You can add a report variable, set its value to "=Now()", and add a filter to the dataset to get records the ship time earlier than the report variable, just like "shiptime < variable1". Then if you view the report at 3:00 PM, you will see records goods are shipped before 3:00 PM. You might ask why not set directly the filter to "shiptime < NOW()", if you do, you will see the records goods will be shipped at the time when the page is turning, not before the whole report rendering. E.g. you view the first page of the report at 3:00 PM, and turn to the second page at 4:00 PM, then you may find records goods are shipped between 3:00 PM and 4:00 PM, because the NOW() function return the time when you turning the page and the expression is calculated every time when you turning. But report variable is calculated only once, then remain unchanged unless you close and reopen the report. It is the important feature of report variables. More information, you can refer to: http://msdn.microsoft.com/en-us/library/bb934256(v=SQL.100).aspx Thanks, YB YeBo
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 5:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics