Dynamically adding a subreport to a page
Re: Dynamically adding a subreport to a page
Hi,
I don't think I can use report.GetComponents() because I am not loading the report from a .mrt file.
In fact, if you look at the code in the attached page 'Default2.aspx' , you will know that the report is being dynamically 'created' in the page. In this case how do I calculate the sum of the group header band. Please let me know.
Thanks.
I don't think I can use report.GetComponents() because I am not loading the report from a .mrt file.
In fact, if you look at the code in the attached page 'Default2.aspx' , you will know that the report is being dynamically 'created' in the page. In this case how do I calculate the sum of the group header band. Please let me know.
Thanks.
- Attachments
-
- Default2.aspx.cs
- Dynamic Report Generation
- (24.64 KiB) Downloaded 215 times
Re: Dynamically adding a subreport to a page
Hello,
In this case please try use the following code:
Thank you.
In this case please try use the following code:
Code: Select all
YourNameTextComponent = new StiExpression("{Totals.Sum(GroupHeaderBand1, Products.UnitPrice)}");
Re: Dynamically adding a subreport to a page
Hi,
Thanks a million !
That did help a lot.
I have 2 more questions:
- How do I disable a group header band based on the value of a field in the datasource
- How to I set the color and font of a text based on its value.( i.e based on whether it is positive or negative)
Thanks.
Thanks a million !
That did help a lot.
I have 2 more questions:
- How do I disable a group header band based on the value of a field in the datasource
- How to I set the color and font of a text based on its value.( i.e based on whether it is positive or negative)
Thanks.
Re: Dynamically adding a subreport to a page
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Re: Dynamically adding a subreport to a page
Hello.
Thank you.
You should use conditions for changing color of the text. Please, watch next videos http://www.stimulsoft.com/en/videos?tags=conditionsprajan wrote:- How to I set the color and font of a text based on its value.( i.e based on whether it is positive or negative)
Thank you.
Re: Dynamically adding a subreport to a page
Hi,
Like I already said, this report is getting generated dynamically, so I cannot use the designer to set the conditions.
I need to know, how we can set conditions in C# code
First condition - I want to disable a group header band depending on the value of a field in the data source
Second condition - I want to know how we can set the color and font of a text based on its value.
Please let me know if I haven't been clear.
Thanks.
Like I already said, this report is getting generated dynamically, so I cannot use the designer to set the conditions.
I need to know, how we can set conditions in C# code
First condition - I want to disable a group header band depending on the value of a field in the data source
Second condition - I want to know how we can set the color and font of a text based on its value.
Please let me know if I haven't been clear.
Thanks.
Re: Dynamically adding a subreport to a page
Hello.
Here is a sample code how to add Conditions:
Thank you.
Here is a sample code how to add Conditions:
Code: Select all
StiCondition highlightcond = new StiCondition();
highlightcond.DataType = StiFilterDataType.Numeric;
highlightcond.TextColor = Color.Red;
highlightcond.Column = "Categories.CategoryID";
highlightcond.Condition = StiFilterCondition.EqualTo;
highlightcond.Value1 = "1";
highlightcond.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Bold);
highlightcond.BackColor = Color.Beige;
highlightcond.Enabled = true;
headerText.Conditions.Add(highlightcond);
Re: Dynamically adding a subreport to a page
Hi,
Thanks a lot. That worked like a dream!
I have another query. I am unable to add vertical line primitives dynamically to the report using C#.
I tried as below, but the line is not seen in the report.
In the above code, I have tried adding the vertical line to a panel.
Previously I tried adding it to a page as well as to a report title band.
In all cases the vertical line is not seen at all.
Any help would be highly appreciated.
Thanks
Thanks a lot. That worked like a dream!
I have another query. I am unable to add vertical line primitives dynamically to the report using C#.
I tried as below, but the line is not seen in the report.
Code: Select all
StiVerticalLinePrimitive stiLine1 = new StiVerticalLinePrimitive();
stiLine1.Top = 2;
stiLine1.Height = 10;
stiLine1.PrintOn = StiPrintOnType.AllPages;
stiLine1.ShiftMode = StiShiftMode.IncreasingSize;
stiLine1.Printable = true;
stiLine1.Enabled = true;
pnReportTitle.Components.Add(stiLine1);
Previously I tried adding it to a page as well as to a report title band.
In all cases the vertical line is not seen at all.
Any help would be highly appreciated.
Thanks
Re: Dynamically adding a subreport to a page
Hello.
Please, try to use Borders instead of the Line Primitives.
Thank you.
Please, try to use Borders instead of the Line Primitives.
Thank you.
Re: Dynamically adding a subreport to a page
Hi,
I need to add line primitives only. I cannot use borders.
Can you please let me know how it is possible?
Thanks
I need to add line primitives only. I cannot use borders.
Can you please let me know how it is possible?
Thanks