Click here to Skip to main content
16,016,580 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a report in stimulsoft in asp.net c#. I created a new connection and then new data source, and added an exiting stored procedure to it. then I assigned columns and parameters this data source to my report.my problem is that : when i create new sqlconnection manually the connection string is :

C#
Data Source=my_pc-PC\my_servername;Integrated Security=True;Initial Catalog=my database_name

when i run my site in my pc every thing is good an work. but when i set my site on web service do i do any thing to show my report successfully. my code for run report:
C#
Stimulsoft.Report.Components.StiText t = new Stimulsoft.Report.Components.StiText();
        t.Text = DateLabel.Text;
        string str4 = Decrypt(Request.QueryString["select_rep_"]);
        if (str4 == "1")
        {
            string str1 = Decrypt(Request.QueryString["fromdate_"]);
            string str2 = Decrypt(Request.QueryString["todate_"]);

            string ConnectionString = ConfigurationManager.ConnectionStrings["my_ejraConnectionString"].ConnectionString;
            string serverlocation = HttpContext.Current.Server.MapPath(string.Empty);
            StiReport myreport = new StiReport();
            myreport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Coneection", ConnectionString));
            t.Text = DateLabel.Text;
            myreport.Load(serverlocation + "\\rep\\myreport.mrt");
            myreport.Dictionary.Variables["fromdate"].Value = str1;
            myreport.Dictionary.Variables["todate"].Value = str2;
            myreport.Dictionary.Variables["today"].Value = t.Text;
            StiWebViewer1.Report = myreport;
        }`enter code here`

is this code work without any change on web server?

What I have tried:

How can I set connection string of a stimulsoft report at run time on web service
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900