Showing posts with label winform. Show all posts
Showing posts with label winform. Show all posts

Wednesday, March 7, 2012

Get sql statement for parameter through reporting service

hi,

i'm creating a winform application that communicates with a reporting service server through the SOAP interface.

If a user selects a report and presses a button a generic screen is created where I create all winforms controls like datetimepicker(if parameter type is DateTime) or combobox (if parameter type is String). When the parameter value is String and there are DefaultValues I add every value to the combobox. But when it has no DefaultValues and thus is generated through SQL I want the SQL statement but I can't find that property. Her you got the code to make it more comprehensive.

[CODE]
else if (rp.Type.ToString() == "String")
{
ComboBox combobox = new ComboBox();
ValidValue[] values = rp.ValidValues;
if (values == null)
{
String sqlString =
}
else
{
foreach (ValidValue value in values)
{
combobox.Items.Add(value.Label.ToString());
}
}
VerControl += 30;
combobox.Location = new Point(HorControl, VerControl);
combobox.Width = 200;
this.Controls.Add(combobox);
}
[/CODE]
hope you can help

greetings
Never mind. When asking for the report parameters I changed the boolean ForRendering to true so I get the values for SQL based parameters too! I don't have the sql statement but i get the values that I need

Sunday, February 26, 2012

Get report in Excel

Hi,

I've made C# winform application where the user can enter it's parameters (I did this so I can do some inputcontrol on the users parameters which I can't in reportviewer cause it's Closed Source).

Now when the user presses the button Get report in Excel. The application should pass the parameters to the SQL statement and complete this. Then the report should be exported to Excel and Excel should start and show me the report.

All this should work behind the scenes and the user should just get the report in Excel. I've added the Web Reference from the report server to my project but I can't seem to find the correct method.

thanks in advance

Hello,

Have a look at the ReportExecutionService class for RS 2005:

http://msdn2.microsoft.com/en-US/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice(SQL.90).aspx

-Chris