all groups > sql server reporting services > october 2006 >
You're in the sql server reporting services group:
displaying date ranges in the report header
sql server reporting services:
I am using a table to structure my report. Body of the report Table header Group Header Details Group Footer Table Footer Earlier I had put the report name with the company logo in the report header section but now I moved it to the body of the report just above the table. I am trying to display the date range next to the report name. I am trying to use an expression saying that if the date parameters are NULL, then print the date today() else print the two date parameters with a hyphen seperating them. On running the report it gives an error that I caanot use expressions in a text box or in the report header. I am creating a variable in the dataset as a calculated field and then setting the expression. Can someone please help?? Regards Jaideep
Chris, Thanks for the help. I am trying to set this expressions and it keeps telling me that dbnull cannot be used. IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value = System.DBNull),Today(),(Parameters!date1.Value & "-" & Parameters!date2.Value)) I have two parameters. I am using a stored proc in the background. If ther parameters are null it gives me data for the previous day. I need to show the report heading as the <Report name> <date>/<date1 - date2> I think it the system does not want to accept the system.DBNull Regards Jaideep [quoted text, click to view] Chris Conner wrote: > Yes, specify the expression in a textbox (assume the textbox name is > textbox5 on the body and make the visibility property FALSE. > > Next, in the report header, for the expression use: > =ReportItems!TextBox5.Value > > =-Chris > > "jai" <dbasybase@gmail.com> wrote in message > news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... > >I am using a table to structure my report. > > > > Body of the report > > > > Table header > > Group Header > > Details > > Group Footer > > Table Footer > > > > Earlier I had put the report name with the company logo in the report > > header section but now I moved it to the body of the report just above > > the table. I am trying to display the date range next to the report > > name. I am trying to use an expression saying that if the date > > parameters are NULL, then print the date today() else print the two > > date parameters with a hyphen seperating them. On running the report it > > gives an error that I caanot use expressions in a text box or in the > > report header. I am creating a variable in the dataset as a calculated > > field and then setting the expression. > > > > Can someone please help?? > > > > Regards > > > > Jaideep > >
I think I got it. I should use is Nothing instead of System.DBNull. I will try what you had said. Jaideep [quoted text, click to view] jai wrote: > Chris, > > Thanks for the help. I am trying to set this expressions and it keeps > telling me that dbnull cannot be used. > > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value > = System.DBNull),Today(),(Parameters!date1.Value & "-" & > Parameters!date2.Value)) > > I have two parameters. I am using a stored proc in the background. If > ther parameters are null it gives me data for the previous day. > > I need to show the report heading as the <Report name> <date>/<date1 - > date2> > > I think it the system does not want to accept the system.DBNull > > Regards > > Jaideep > Chris Conner wrote: > > Yes, specify the expression in a textbox (assume the textbox name is > > textbox5 on the body and make the visibility property FALSE. > > > > Next, in the report header, for the expression use: > > =ReportItems!TextBox5.Value > > > > =-Chris > > > > "jai" <dbasybase@gmail.com> wrote in message > > news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... > > >I am using a table to structure my report. > > > > > > Body of the report > > > > > > Table header > > > Group Header > > > Details > > > Group Footer > > > Table Footer > > > > > > Earlier I had put the report name with the company logo in the report > > > header section but now I moved it to the body of the report just above > > > the table. I am trying to display the date range next to the report > > > name. I am trying to use an expression saying that if the date > > > parameters are NULL, then print the date today() else print the two > > > date parameters with a hyphen seperating them. On running the report it > > > gives an error that I caanot use expressions in a text box or in the > > > report header. I am creating a variable in the dataset as a calculated > > > field and then setting the expression. > > > > > > Can someone please help?? > > > > > > Regards > > > > > > Jaideep > > >
Chris, I created the text box in the body and set the expression which is being displayed properly. Now I created another text box in the report header section and in the expression I said ReportItems!TextBox5.Value It is giving me an error -- The Value expression for the textbox 'textbox17' contains an error: The expression referenced a non-existing reportitem in the reportitems collection. Preview complete -- 0 errors, 1 warnings I can understand the error but how do i add something to the reportitems collection??? Jaideep [quoted text, click to view] Chris Conner wrote: > Don't use that = use instead iif((Parameters!date1.Value = Nothing .... > > to test for nullability. > > =-Chris > > "jai" <dbasybase@gmail.com> wrote in message > news:1161371300.024539.176980@k70g2000cwa.googlegroups.com... > > Chris, > > > > Thanks for the help. I am trying to set this expressions and it keeps > > telling me that dbnull cannot be used. > > > > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value > > = System.DBNull),Today(),(Parameters!date1.Value & "-" & > > Parameters!date2.Value)) > > > > I have two parameters. I am using a stored proc in the background. If > > ther parameters are null it gives me data for the previous day. > > > > I need to show the report heading as the <Report name> <date>/<date1 - > > date2> > > > > I think it the system does not want to accept the system.DBNull > > > > Regards > > > > Jaideep > > Chris Conner wrote: > >> Yes, specify the expression in a textbox (assume the textbox name is > >> textbox5 on the body and make the visibility property FALSE. > >> > >> Next, in the report header, for the expression use: > >> =ReportItems!TextBox5.Value > >> > >> =-Chris > >> > >> "jai" <dbasybase@gmail.com> wrote in message > >> news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... > >> >I am using a table to structure my report. > >> > > >> > Body of the report > >> > > >> > Table header > >> > Group Header > >> > Details > >> > Group Footer > >> > Table Footer > >> > > >> > Earlier I had put the report name with the company logo in the report > >> > header section but now I moved it to the body of the report just above > >> > the table. I am trying to display the date range next to the report > >> > name. I am trying to use an expression saying that if the date > >> > parameters are NULL, then print the date today() else print the two > >> > date parameters with a hyphen seperating them. On running the report it > >> > gives an error that I caanot use expressions in a text box or in the > >> > report header. I am creating a variable in the dataset as a calculated > >> > field and then setting the expression. > >> > > >> > Can someone please help?? > >> > > >> > Regards > >> > > >> > Jaideep > >> > > >
Yes, specify the expression in a textbox (assume the textbox name is textbox5 on the body and make the visibility property FALSE. Next, in the report header, for the expression use: =ReportItems!TextBox5.Value =-Chris [quoted text, click to view] "jai" <dbasybase@gmail.com> wrote in message news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... >I am using a table to structure my report. > > Body of the report > > Table header > Group Header > Details > Group Footer > Table Footer > > Earlier I had put the report name with the company logo in the report > header section but now I moved it to the body of the report just above > the table. I am trying to display the date range next to the report > name. I am trying to use an expression saying that if the date > parameters are NULL, then print the date today() else print the two > date parameters with a hyphen seperating them. On running the report it > gives an error that I caanot use expressions in a text box or in the > report header. I am creating a variable in the dataset as a calculated > field and then setting the expression. > > Can someone please help?? > > Regards > > Jaideep >
Thanks that did the trick. But I found another problem. If the date range is one day apart then the text box displays the correct values but if the range is more than two days, then it does not display the values but the report returns the data. Any ideas??? Jaideep [quoted text, click to view] Chris Conner wrote: > I forgot to mention - it is CASE sensitive.. by default, the textbox names > are in lowercase. Sorry about that. > > =-Chris > > "jai" <dbasybase@gmail.com> wrote in message > news:1161374030.963039.245760@b28g2000cwb.googlegroups.com... > > Chris, > > I created the text box in the body and set the expression which is > > being displayed properly. Now I created another text box in the report > > header section and in the expression I said > > ReportItems!TextBox5.Value > > > > It is giving me an error -- > > The Value expression for the textbox 'textbox17' contains an error: > > The expression referenced a non-existing reportitem in the reportitems > > collection. > > Preview complete -- 0 errors, 1 warnings > > > > I can understand the error but how do i add something to the > > reportitems collection??? > > > > Jaideep > > > > > > > > Chris Conner wrote: > >> Don't use that = use instead iif((Parameters!date1.Value = Nothing .... > >> > >> to test for nullability. > >> > >> =-Chris > >> > >> "jai" <dbasybase@gmail.com> wrote in message > >> news:1161371300.024539.176980@k70g2000cwa.googlegroups.com... > >> > Chris, > >> > > >> > Thanks for the help. I am trying to set this expressions and it keeps > >> > telling me that dbnull cannot be used. > >> > > >> > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value > >> > = System.DBNull),Today(),(Parameters!date1.Value & "-" & > >> > Parameters!date2.Value)) > >> > > >> > I have two parameters. I am using a stored proc in the background. If > >> > ther parameters are null it gives me data for the previous day. > >> > > >> > I need to show the report heading as the <Report name> <date>/<date1 - > >> > date2> > >> > > >> > I think it the system does not want to accept the system.DBNull > >> > > >> > Regards > >> > > >> > Jaideep > >> > Chris Conner wrote: > >> >> Yes, specify the expression in a textbox (assume the textbox name is > >> >> textbox5 on the body and make the visibility property FALSE. > >> >> > >> >> Next, in the report header, for the expression use: > >> >> =ReportItems!TextBox5.Value > >> >> > >> >> =-Chris > >> >> > >> >> "jai" <dbasybase@gmail.com> wrote in message > >> >> news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... > >> >> >I am using a table to structure my report. > >> >> > > >> >> > Body of the report > >> >> > > >> >> > Table header > >> >> > Group Header > >> >> > Details > >> >> > Group Footer > >> >> > Table Footer > >> >> > > >> >> > Earlier I had put the report name with the company logo in the > >> >> > report > >> >> > header section but now I moved it to the body of the report just > >> >> > above > >> >> > the table. I am trying to display the date range next to the report > >> >> > name. I am trying to use an expression saying that if the date > >> >> > parameters are NULL, then print the date today() else print the two > >> >> > date parameters with a hyphen seperating them. On running the report > >> >> > it > >> >> > gives an error that I caanot use expressions in a text box or in the > >> >> > report header. I am creating a variable in the dataset as a > >> >> > calculated > >> >> > field and then setting the expression. > >> >> > > >> >> > Can someone please help?? > >> >> > > >> >> > Regards > >> >> > > >> >> > Jaideep > >> >> > > >> > > >
Don't use that = use instead iif((Parameters!date1.Value = Nothing .... to test for nullability. =-Chris [quoted text, click to view] "jai" <dbasybase@gmail.com> wrote in message news:1161371300.024539.176980@k70g2000cwa.googlegroups.com... > Chris, > > Thanks for the help. I am trying to set this expressions and it keeps > telling me that dbnull cannot be used. > > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value > = System.DBNull),Today(),(Parameters!date1.Value & "-" & > Parameters!date2.Value)) > > I have two parameters. I am using a stored proc in the background. If > ther parameters are null it gives me data for the previous day. > > I need to show the report heading as the <Report name> <date>/<date1 - > date2> > > I think it the system does not want to accept the system.DBNull > > Regards > > Jaideep > Chris Conner wrote: >> Yes, specify the expression in a textbox (assume the textbox name is >> textbox5 on the body and make the visibility property FALSE. >> >> Next, in the report header, for the expression use: >> =ReportItems!TextBox5.Value >> >> =-Chris >> >> "jai" <dbasybase@gmail.com> wrote in message >> news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... >> >I am using a table to structure my report. >> > >> > Body of the report >> > >> > Table header >> > Group Header >> > Details >> > Group Footer >> > Table Footer >> > >> > Earlier I had put the report name with the company logo in the report >> > header section but now I moved it to the body of the report just above >> > the table. I am trying to display the date range next to the report >> > name. I am trying to use an expression saying that if the date >> > parameters are NULL, then print the date today() else print the two >> > date parameters with a hyphen seperating them. On running the report it >> > gives an error that I caanot use expressions in a text box or in the >> > report header. I am creating a variable in the dataset as a calculated >> > field and then setting the expression. >> > >> > Can someone please help?? >> > >> > Regards >> > >> > Jaideep >> > >
I forgot to mention - it is CASE sensitive.. by default, the textbox names are in lowercase. Sorry about that. =-Chris [quoted text, click to view] "jai" <dbasybase@gmail.com> wrote in message news:1161374030.963039.245760@b28g2000cwb.googlegroups.com... > Chris, > I created the text box in the body and set the expression which is > being displayed properly. Now I created another text box in the report > header section and in the expression I said > ReportItems!TextBox5.Value > > It is giving me an error -- > The Value expression for the textbox 'textbox17' contains an error: > The expression referenced a non-existing reportitem in the reportitems > collection. > Preview complete -- 0 errors, 1 warnings > > I can understand the error but how do i add something to the > reportitems collection??? > > Jaideep > > > > Chris Conner wrote: >> Don't use that = use instead iif((Parameters!date1.Value = Nothing .... >> >> to test for nullability. >> >> =-Chris >> >> "jai" <dbasybase@gmail.com> wrote in message >> news:1161371300.024539.176980@k70g2000cwa.googlegroups.com... >> > Chris, >> > >> > Thanks for the help. I am trying to set this expressions and it keeps >> > telling me that dbnull cannot be used. >> > >> > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value >> > = System.DBNull),Today(),(Parameters!date1.Value & "-" & >> > Parameters!date2.Value)) >> > >> > I have two parameters. I am using a stored proc in the background. If >> > ther parameters are null it gives me data for the previous day. >> > >> > I need to show the report heading as the <Report name> <date>/<date1 - >> > date2> >> > >> > I think it the system does not want to accept the system.DBNull >> > >> > Regards >> > >> > Jaideep >> > Chris Conner wrote: >> >> Yes, specify the expression in a textbox (assume the textbox name is >> >> textbox5 on the body and make the visibility property FALSE. >> >> >> >> Next, in the report header, for the expression use: >> >> =ReportItems!TextBox5.Value >> >> >> >> =-Chris >> >> >> >> "jai" <dbasybase@gmail.com> wrote in message >> >> news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... >> >> >I am using a table to structure my report. >> >> > >> >> > Body of the report >> >> > >> >> > Table header >> >> > Group Header >> >> > Details >> >> > Group Footer >> >> > Table Footer >> >> > >> >> > Earlier I had put the report name with the company logo in the >> >> > report >> >> > header section but now I moved it to the body of the report just >> >> > above >> >> > the table. I am trying to display the date range next to the report >> >> > name. I am trying to use an expression saying that if the date >> >> > parameters are NULL, then print the date today() else print the two >> >> > date parameters with a hyphen seperating them. On running the report >> >> > it >> >> > gives an error that I caanot use expressions in a text box or in the >> >> > report header. I am creating a variable in the dataset as a >> >> > calculated >> >> > field and then setting the expression. >> >> > >> >> > Can someone please help?? >> >> > >> >> > Regards >> >> > >> >> > Jaideep >> >> > >> > >
Chris, I have been seeing that if the report is more than one page, the system prints the date range in the report header on the last page. I checked the properties but did not find anything unusual there. Regards Jaideep [quoted text, click to view] jai wrote: > Thanks that did the trick. But I found another problem. If the date > range is one day apart then the text box displays the correct values > but if the range is more than two days, then it does not display the > values but the report returns the data. > > Any ideas??? > > Jaideep > Chris Conner wrote: > > I forgot to mention - it is CASE sensitive.. by default, the textbox names > > are in lowercase. Sorry about that. > > > > =-Chris > > > > "jai" <dbasybase@gmail.com> wrote in message > > news:1161374030.963039.245760@b28g2000cwb.googlegroups.com... > > > Chris, > > > I created the text box in the body and set the expression which is > > > being displayed properly. Now I created another text box in the report > > > header section and in the expression I said > > > ReportItems!TextBox5.Value > > > > > > It is giving me an error -- > > > The Value expression for the textbox 'textbox17' contains an error: > > > The expression referenced a non-existing reportitem in the reportitems > > > collection. > > > Preview complete -- 0 errors, 1 warnings > > > > > > I can understand the error but how do i add something to the > > > reportitems collection??? > > > > > > Jaideep > > > > > > > > > > > > Chris Conner wrote: > > >> Don't use that = use instead iif((Parameters!date1.Value = Nothing .... > > >> > > >> to test for nullability. > > >> > > >> =-Chris > > >> > > >> "jai" <dbasybase@gmail.com> wrote in message > > >> news:1161371300.024539.176980@k70g2000cwa.googlegroups.com... > > >> > Chris, > > >> > > > >> > Thanks for the help. I am trying to set this expressions and it keeps > > >> > telling me that dbnull cannot be used. > > >> > > > >> > IIf((Parameters!date1.Value = System.DBNull And Parameters!date2.Value > > >> > = System.DBNull),Today(),(Parameters!date1.Value & "-" & > > >> > Parameters!date2.Value)) > > >> > > > >> > I have two parameters. I am using a stored proc in the background. If > > >> > ther parameters are null it gives me data for the previous day. > > >> > > > >> > I need to show the report heading as the <Report name> <date>/<date1 - > > >> > date2> > > >> > > > >> > I think it the system does not want to accept the system.DBNull > > >> > > > >> > Regards > > >> > > > >> > Jaideep > > >> > Chris Conner wrote: > > >> >> Yes, specify the expression in a textbox (assume the textbox name is > > >> >> textbox5 on the body and make the visibility property FALSE. > > >> >> > > >> >> Next, in the report header, for the expression use: > > >> >> =ReportItems!TextBox5.Value > > >> >> > > >> >> =-Chris > > >> >> > > >> >> "jai" <dbasybase@gmail.com> wrote in message > > >> >> news:1161364744.236416.98920@k70g2000cwa.googlegroups.com... > > >> >> >I am using a table to structure my report. > > >> >> > > > >> >> > Body of the report > > >> >> > > > >> >> > Table header > > >> >> > Group Header > > >> >> > Details > > >> >> > Group Footer > > >> >> > Table Footer > > >> >> > > > >> >> > Earlier I had put the report name with the company logo in the > > >> >> > report > > >> >> > header section but now I moved it to the body of the report just > > >> >> > above > > >> >> > the table. I am trying to display the date range next to the report > > >> >> > name. I am trying to use an expression saying that if the date > > >> >> > parameters are NULL, then print the date today() else print the two > > >> >> > date parameters with a hyphen seperating them. On running the report > > >> >> > it > > >> >> > gives an error that I caanot use expressions in a text box or in the > > >> >> > report header. I am creating a variable in the dataset as a > > >> >> > calculated > > >> >> > field and then setting the expression. > > >> >> > > > >> >> > Can someone please help?? > > >> >> > > > >> >> > Regards > > >> >> > > > >> >> > Jaideep > > >> >> > > > >> > > > >
Don't see what you're looking for? Try a search.
|
|
|