I want to use a single Crystal report (.rpt) file for two actual reports, changing only the title and the data. I've got the data working, but I can't seem to get the title part right. I tried to follow this
tutorial, but when I do my report just disappears (whether I set the parameter or not). I created a "Report Title" special field and dragged it to my page header. Then I brought up the formula editor on the report title display string and clicked on my
title parameter. So the formula ends up being
{?Title}
I'm sure I'm probably just making a rookie mistake here. Can anyone provide any advice as to what I'm doing wrong?
I don't think the passing of the parameter is really the problem. It's how to use the parameter value to update the report. I this case I want to know how to make the parameter value be used as the title of the report.
This seems to work to use a parameter for record selection, but I'm interested in using a parameter to change the text in the report itself...in this case the title of the report. So, I need a way for a parameter to be assigned to a text object or maybe
the "report title" special field, but I can't seem to find a way to make the assignment in the formula editor.
DKP1110
Member
167 Points
54 Posts
setting a report title programmatically
Feb 19, 2011 10:28 PM|LINK
I want to use a single Crystal report (.rpt) file for two actual reports, changing only the title and the data. I've got the data working, but I can't seem to get the title part right. I tried to follow this tutorial, but when I do my report just disappears (whether I set the parameter or not). I created a "Report Title" special field and dragged it to my page header. Then I brought up the formula editor on the report title display string and clicked on my title parameter. So the formula ends up being
{?Title}
I'm sure I'm probably just making a rookie mistake here. Can anyone provide any advice as to what I'm doing wrong?
cnranasinghe
Star
8885 Points
1798 Posts
Re: setting a report title programmatically
Feb 22, 2011 02:47 AM|LINK
you can pass a parameter simply
http://www.c-sharpcorner.com/UploadFile/mahesh/paramInCR11012006132839PM/paramInCR.aspx
DKP1110
Member
167 Points
54 Posts
Re: setting a report title programmatically
Feb 24, 2011 01:14 PM|LINK
I don't think the passing of the parameter is really the problem. It's how to use the parameter value to update the report. I this case I want to know how to make the parameter value be used as the title of the report.
cnranasinghe
Star
8885 Points
1798 Posts
Re: setting a report title programmatically
Feb 25, 2011 03:38 AM|LINK
Aproach is depending on logic you are appying
following thread discuss something similar
http://forums.asp.net/p/1318580/2614660.aspx
DKP1110
Member
167 Points
54 Posts
Re: setting a report title programmatically
Mar 02, 2011 12:09 AM|LINK
This seems to work to use a parameter for record selection, but I'm interested in using a parameter to change the text in the report itself...in this case the title of the report. So, I need a way for a parameter to be assigned to a text object or maybe the "report title" special field, but I can't seem to find a way to make the assignment in the formula editor.
Does anyone have any ideas?
DKP1110
Member
167 Points
54 Posts
Re: setting a report title programmatically
Mar 04, 2011 01:46 AM|LINK
Looks like you do it by adding the special field "Report Title" to the report and then doing the following in the code:
MyReport report = new MyReport();
report.SummaryInfo.ReportTitle = "My Title";