report.CompiledReport[""] vs report.Dictionary.Variables[""]

Stimulsoft Reports.NET discussion
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
mmmmmm
Posts: 27
Joined: Mon Oct 24, 2011 5:51 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by mmmmmm »

Hi Aleksey,

It seems I tried everything and still I am not able to pass a List of strings to a report and then access its elements via {Tags[PageNumber - 1]} expression.
Can you please provide a sample application that simply passes a list of strings from code behind to a report and then renders that report in a web viewer?

I will really appreciate such help.
(ps: I am using the latest demo release)

Thank you very much.
mmmmmm
Posts: 27
Joined: Mon Oct 24, 2011 5:51 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by mmmmmm »

If in the report I am using the following expression "{Tags}" it gets rendered as "Stimulsoft.Report.StringList".
I think it is logical to assume that the type is correct. However, if I use one of the following expressions, nothing gets rendered:
{Tags[0]}
{Tags.Count}
{Tags[PageNumber-1]}
mmmmmm
Posts: 27
Joined: Mon Oct 24, 2011 5:51 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by mmmmmm »

Calculation mode is set to report.CalculationMode = StiCalculationMode.Interpretation;
(due to out of memory of w3wp.exe when compiling a large report)
mmmmmm
Posts: 27
Joined: Mon Oct 24, 2011 5:51 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by mmmmmm »

Hi Aleksey,

I honestly think I've tried everything I could think of to achieve what I need. Please help me on this one.
Here is the exact scenario:
1. I have a report with multiple pages, each page displays a table of data (DataTables dynamically registered from code behind)
2. report.CalculationMode = StiCalculationMode.Interpretation; to avoid out of memory when compiling
3.On each page;s header I need to display different names (each DataTable's data source name)
Something like: "Data for {Tag}"

Having multiple pages and multiple datatables I thought the right approach is to pass a List<string> as a report variable and in the header use "Data for {Tags[PageNumber]}"

Even though, with report.CalculationMode set to Compilation, this scenario works, when using as described it does not.

Aleksey, can you please supply me a basic simple working sample of such implementation.

Thank you and I hope for an early reply.

Regards.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by HighAley »

Hello.

Please, look at the attached report template.
Report.mrt
(5.02 KiB) Downloaded 382 times
Thank you.
mmmmmm
Posts: 27
Joined: Mon Oct 24, 2011 5:51 am

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by mmmmmm »

Hi,

thank you for the sample report.
I see it does work when the values are initialized from within the report itself. It also works when StiCalculationMode is set to Compile.

However, when passing this string list from codebehind with StiCalculationMode set to Interpretations it does not work.

List<Stimulsoft.Report.Dictionary.StiDialogInfoItem> list = report.Dictionary.Variables["EntityTags"].DialogInfo.GetDialogInfoItems(typeof(StringList));

Stimulsoft.Report.Dictionary.StiStringDialogInfoItem it = new Stimulsoft.Report.Dictionary.StiStringDialogInfoItem();
it.Value = "item 1";
list.Add(it);

Stimulsoft.Report.Dictionary.StiStringDialogInfoItem it2 = new Stimulsoft.Report.Dictionary.StiStringDialogInfoItem();
it2.Value = "item 2";
list.Add(it2);

This shows count = 2

Code: Select all

Log(String.Format("list count: {0}", list.Count)); // <---- this shows count = 2
In a databand inside the mrt, this shows nothing:

Code: Select all

{EntityTags[PageNumber-1]}              <==== this shows nothing

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: report.CompiledReport[""] vs report.Dictionary.Variables

Post by HighAley »

Hello.

We couldn't reproduce your issue.
Please, send us a working sample project which reproduces the issue.

Thank you.
Post Reply