logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
itsbigfoot53  
#1 Posted : Thursday, July 5, 2018 7:33:11 PM(UTC)
itsbigfoot53

Rank: Newbie

Groups: Registered
Joined: 7/2/2018(UTC)
Posts: 8
United States

Hello All,
Im trying to add 2 fields to my report name when the report is executed I can get it to change the name and add the date with script below but I cant figure out how to add the 2 fields that have been previously selected by the user.


report.DisplayName = "..Freight Analysis of " + DateTime.Now.ToShortDateString();

I have 2 dropdowns for the user to select a number and a type from enumerated lists and I would like to add the users selections to the above report name when they execute the report. EG..
Freight analysis of TL for 05 and then the date.


Any help is greatly appreciated :)

Thanks
Bruce
epf  
#2 Posted : Friday, July 6, 2018 8:47:47 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 post(s)
Yes you can use the values of the restrictions, there are several posts and samples showing this (e.g. report 52-User Input or make a search in the forum on GetRestrictionByName).
For the report name, you can also use the dedicated script:
Select Views, then edit the Display Name property:

Code:
Report report = Model;
ReportModel model = report.Models[0];
ReportRestriction restriction = model.GetRestrictionByName("Columns Displayed");
string result = restriction.EnumValues[0];


This takes the first restriction value (enumerated list) of the first model of the report.

Edited by user Friday, July 6, 2018 9:02:11 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.