Page 1 of 1
Can I customize the report without opening report designer?
Posted: Thu Jul 19, 2012 4:41 am
by jinzhouwan
Report designer is very powerful and may be too much for end user. Can we customize the report without report designer?
Here's an example about our requirement. After loading the report, we need do following things:
1. Pick a cell
2. Set line style, font for selected cell
3. Add a row or column into header band.
4. Add or remove fields from data band at run time
Thank you in advance!
Re: Can I customize the report without opening report design
Posted: Thu Jul 19, 2012 2:16 pm
by HighAley
Hello.
jinzhouwan wrote:Report designer is very powerful and may be too much for end user. Can we customize the report without report designer?
Here's an example about our requirement. After loading the report, we need do following things:
1. Pick a cell
2. Set line style, font for selected cell
3. Add a row or column into header band.
4. Add or remove fields from data band at run time
You could change your report at runtime in your code.
Here is a sample project how to create report there you could find some useful code.
Also you could look at the code page in the Designer to find out how change reports.
If you have some additional questions, please do not hesitate to contact us.
Thank you.
Re: Can I customize the report without opening report design
Posted: Fri Jul 20, 2012 1:26 am
by jinzhouwan
Thank you for your quick response! And I have another question.
How can I capture the event about clicking a cell? Can I catpture the event in webviewer?
I added following lines before report.Complie
Code: Select all
StiComponentsCollection components = report.GetComponents();
foreach (StiComponent component in components)
{
component.Click += new System.EventHandler(Cell_Click);
}
report.Compile();
report.Show();
and I added a event named Cell_Click
Code: Select all
private void Cell_Click(object sender, EventArgs e)
{
StiComponent component = sender as StiComponent;
if (component != null)
MessageBox.Show(component.Name);
}
But I still cannot capture the event about clicking a cell.
Re: Can I customize the report without opening report design
Posted: Fri Jul 20, 2012 9:45 am
by HighAley
Hello.
There is no events in StiWebViewer.
Thank you.
Re: Can I customize the report without opening report design
Posted: Fri Jul 20, 2012 2:07 pm
by jinzhouwan
I tried these codes in the sample you attached,but doesnt work. WHat,s wrong?
It's said that StiWebViewerFx support event, I think I can support event in simlar way as winform application, right?
Thank you!
Re: Can I customize the report without opening report design
Posted: Mon Jul 23, 2012 2:18 pm
by HighAley
Hello.
jinzhouwan wrote:I tried these codes in the sample you attached,but doesnt work. WHat,s wrong?
Please send us your project. What errors or exceptions do you have?
jinzhouwan wrote:It's said that StiWebViewerFx support event, I think I can support event in simlar way as winform application, right?
The events isn't supported by StiWebViewer and StiWebViewerFx. It's impossible to do in browsers.
Th events is supported in .Net and Wpf products only.
Thank you.