Telerik Forums
Reporting Forum
5 answers
808 views
  I have a report which has some table controls on it. This report also has embedded subreports on it. I have the requirement of taking some info about the user(username) from my web app and passing it as a parameter to my telerik report. I have watched the video for paramterized queries (here) and am trying to model after this. It works....only sort of... 
   What is weird is that the parameters are passed just fine to my subreports . I use the NeedDataSource Event to do so. For some reason, when I try to pass the parameters to the queries (I am calling stored procs) that populate the table controls(again these controls are directly on the report),  these values get lost somehow.   Very weird, as I would think the the exact opposite would potentially be the case.
  I turned sql profiler on and I can see the queries running for the table controls with a blank string " " for the parameters that are suppose to be passed. Even weirder is if I make the paramers visible in the automatic UI, (while making absolutely certain that no value has been hardcoded for them in the properties window of Visual Studio, Value field is blank) I do in fact see the values in the automatic UI that are supposed to be passed to the report.  I tried using the different events(NeedDataSource, ItemDataBound, etc) to bind the table controls but to no avail.
   Based on what I'm experiencing I would think there is something about the report life cycle that I am currently not understanding, but I am not sure. Below are my code snippets with comments. If you can offer any direction I would be greatly appreciative. -Jason
//this from my .aspx codebehind  
 
 
public partial class reporting_rep_invprodby_newlook2 : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
            string username = User.Identity.Name;  
            MasterReport report1 = new MasterReport();  
            ReportViewer1.Report = report1;  
            //setting the value of Param1 in the line below  
            report1.Param1 = username;  
     }  
 ------------------------------------------------------------------------------  
 
//this from the telerik report codebehind  
     
 
// Here is a sample query where the value for @ousername_vc   
//(this.ReportParameters["ousername_vc"].Value) gets lost  
   
SqlConnection connSomsys = new SqlConnection(@"Server=cmdivst004\Jason08;Integrated Security=false;Database=QuoteDB; Persist Security Info=True;User ID=gggg;Password=gggg");  
 
SqlCommand selectLastYearTot;  
selectLastYearTot = new SqlCommand("sprocgetOrdertotlastyear", connSomsys);  
 
selectLastYearTot.CommandType = CommandType.StoredProcedure;  
 
selectLastYearTot.Parameters.AddWithValue("@ousername_vc"this.ReportParameters["ousername_vc"].Value);  
 
adapter3.Fill(dataSet3);  
this.table3.DataSource = dataSet3;  
 
//this is for one of the subreports in the NeedDataSource Event   
//for the subreport, it works fine  
 
SqlConnection connSomsys = new SqlConnection(@"Server=cmdivst004\Jason08;Integrated Security=false;Database=QuoteDB; Persist Security Info=True;User ID=cmdiapp;Password=adiadmin");  
Telerik.Reporting.Processing.SubReport report =(Telerik.Reporting.Processing.SubReport)sender;  
 
SqlCommand selectCommand;  
selectCommand = new SqlCommand("sprocgetaccountingorders", connSomsys);  
selectCommand.CommandType = CommandType.StoredProcedure;  
//works fine right here line below  
selectCommand.Parameters.AddWithValue("@ousername_vc"this.ReportParameters["ousername_vc"].Value);  
SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);  
DataSet dataSet = new DataSet();  
adapter.Fill(dataSet);  
report.InnerReport.DataSource = dataSet;  
connSomsys.Dispose();  
 
//Here is the property I created to take in the value of the username  
//much like the video  
   public string Param1  
        {  
 
            get 
            {  
                return (string)this.ReportParameters["ousername_vc"].Value;  
            }  
            set 
            {  
                this.ReportParameters["ousername_vc"].Value = value;  
            }  
        }  
 
         
Sebastian
Top achievements
Rank 1
 answered on 04 Jan 2011
2 answers
147 views
I'm curious whether or not Telerik is already working toward speeding up Telerik Reporting with the new printing features of Silverlight 5.  I have worked with Telerik Reporting for the last 6 months and it's very nice but very slow. 

thanks,

Tim
Timothy Kelley
Top achievements
Rank 1
 answered on 03 Jan 2011
0 answers
100 views
I am trying to set up multiple parameters for a report.  The first has a datasource that lists a series of dates from a table.  This is no problem. What I want to do is calculate an 'end date' value for the second parameter based on the date selected in the first parameter and then pass the two parameters to the SQL statement that is the datasource for the report.  I know how to accomplish the second part and have written the calculation procedure I need in a class module.  What I can't figure out is how to invoke the procedure when the user selects a date in the first parameter. Thanks for any suggestions
Chuck Harrington
Top achievements
Rank 1
 asked on 31 Dec 2010
2 answers
109 views
hi,

i need to show dates calender grid/matrix in the report like
---------------------------------
jan       01 02 03 ... 31
Qty           7    2
Mar     01 02 03 ... 31
Qty       3       6
---------------------------------
so what is the best way to design that matrix consider that more rows might be required beside the Qty. i thought of doing that fully in the code-behind by formatting the matrix as html then include it in the detail section. please recommend the best flexible approach to design that?

thanks,
Mazen Bteddini
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
123 views
Hello,

I have used crystal reports a little bit, but I am totally new to Telerik Reporting. I have successfully created a report with a sub report, but I need help with how to do something. I am basically creating a receipt, but instead of each item being repeated as text, the item will be displayed as a certificate. Basically, the customer can purchase one set of different types of certificates. Each set can have a different amount of certificates. Some certificates have 2 per package and some can have 5. I have successfully created a report that displays the customer address information and summary information. I have also created a sub report in that report that gets each item the customer purchased and uses an image as the background with text over the top to be printed out to create the certificate. So if they purchased two sets of certificate it will display two certificates currently. What I haven't been able to figure out is how to repeate the certificate in the report to match the number of certificates that come in a package. I do get the value telling me how many certificates come per package, I just don't know how to use it to repeat the output. Is that possible? If so, how can I make that happen?

I hope I have explained this clearly. I am not always the best at explaining things.

Thank you.

Ben
Benjamin
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
126 views
Hi Telerik Team!

In our concern we follow several methods to bind the fields such as "binding thro dataset","binding directly using functions","binding the data using object data source".
Out of all these methods, data get binded & the field values get populated in the "expression" of the report viewer only when "objectdatasource method" is used.when we use the rest of the methods, we developers face the problem of writing the code manually. i.e(Fields.EmployeeName)
We doesnot face these sort of problems in other reporting services.
Why it is so??Why this functionality doesn't support for all the methods?


Regards
Aabidha

Steve
Telerik team
 answered on 30 Dec 2010
1 answer
97 views
Hello,
we've to introduce in a report a 4 pages document that contains justified and formatted text... we've tried exporting it to HTML using MS Word and inserting it in the designer of a HTMLTextBox ... on the display inside the editor it's formatted ok, in the report it does not apply the spacing (150%) and the justify.... any suggestion?
Thanks
Steve
Telerik team
 answered on 30 Dec 2010
1 answer
94 views
hi,

i'm applying the best practice approach for the telerik reporting in which they being put in separate c# project. i could access them from the web application be getting assembly info...like this:

var reportAssembly = AppDomain.CurrentDomain
                     .GetAssemblies()
                     .Where(x => x.GetName().Name == REPORT_NAMESPACE).FirstOrDefault();
                    Type reportType = reportAssembly.GetType(rptInfo.ReportClassName);
                    var report = (Report)Activator.CreateInstance(reportType);
                    report.DataSource = results;

but after publishing the report not showing so can you provide full demo for best way for applying that!
Steve
Telerik team
 answered on 30 Dec 2010
2 answers
87 views

After upgrading to Q3, I cannot apply built-in stylesheets like civic or solstice to reports. Can you try and tell me if it is working?

Thank you.

bora
Top achievements
Rank 1
 answered on 30 Dec 2010
2 answers
98 views
I have just downloaded Q3 sp1 for telerik reporting, tried to install but setup file is still installing version 4_2_10_1110. Is there any conflicts on your setup files?
bora
Top achievements
Rank 1
 answered on 30 Dec 2010
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?