Telerik Forums
Reporting Forum
1 answer
124 views
Hi,

I'm using Enterprise Library to return a DataSet(from a stored procedure) that i use as my datasource to my report.
I have the report almost setup for me but i have trouble with one thing. The report has two columns

  • NoOfHours
  • DebitPerUnitHour

Example:
If one detail row has NoOfHours=8 and DebitPerUnitHour=$600, then i have a third column that calculates [=Fields.NoOfHours * Fields.DebitPerUnitHour].

Then I need in my footersection in my group to SUM the values from this third column. I know its simple to sum on an existing Field from satasource, but how to sum on an expression?

/Daniel
Steve
Telerik team
 answered on 02 Oct 2009
1 answer
120 views

Hi,

I have created a UserControl (ascx) with the Report Viewer. I am creating instances of my report classes dynamically. My Report viewer code looks like this:

            if (!Page.IsPostBack)  
            {  
                if (!string.IsNullOrEmpty(_reportName))  
                {  
                    PageManagementDataContext db = new PageManagementDataContext();  
 
                    var rec = db.ReportGetByReportIDAndLCID(Convert.ToInt32(_reportName), "is-IS").FirstOrDefault();  
 
                    if (rec != null)  
                    {  
                          
                        Object obj = Activator.CreateInstance(Type.GetType("Orbit.Benjamin.Reports." + rec.systemname));  
 
                        Telerik.Reporting.Report rpt = (Telerik.Reporting.Report)obj;  
 
                          
                        ReportViewer1.Report = rpt;  
                        ReportViewer1.ZoomMode = Telerik.ReportViewer.WebForms.ZoomMode.Percent;  
                        ReportViewer1.ZoomPercent = 100;  
                        ReportViewer1.Style["height"] = "30cm";  
                    }  
                }  
            }  
 
        }  
 
        protected object GetNewType(string classname)  
        {  
            Type type = Type.GetType(classname, true);  
            object newInstance = Activator.CreateInstance(type);  
            return newInstance;  
        } 

Everyting was working fine until I tried to add parameters to a report. I'm adding a parameter using this code:
var enterpr = db.EnterprisesAndDivisionsGetAll().Where(d => d.partyroleid != 4);  
 
var parameter = this.ReportParameters["Company"];  
parameter.UI.AvailableValues.DataSource = enterpr.Select(o => o.partyname);  
parameter.Value = enterpr.Select(o => o.id); 

This causes my class instance to fail. I suspect I need to do something to also handle the parameters when creating the class instance. Can someone point me in the right direction please.

reg.
Axel

Axel
Top achievements
Rank 2
 answered on 02 Oct 2009
7 answers
165 views
Hi

When creating a report using the Wizard, the Wizard window disappears when I am selecting fields for list items, groups etc.
This seems to happen when I try to expand the data explorer treeview and click the +/- boxes to expand specific fields.

Is this a known bug ?

reg.
Axel G.
Steve
Telerik team
 answered on 02 Oct 2009
5 answers
166 views
When installing - I'm getting - Failed to execute SQL string, error detail: Invalid object name 'master.sys.databases'., SQL key: createAdventureWorks1.........

I'm installing on XP and trying to point to an existing SQL Server 2000 database.

Thanks,

Jason
Hrisi
Telerik team
 answered on 01 Oct 2009
1 answer
283 views

Hi guys,

I am working on an application which uses Telerik Reports to generate reports using the PDF rendering extension. The reporting logic in the application allows the users to schedule the reports generation. Because of performance and scalability reasons, the reports are generated (rendered to PDF) each on a different thread.

Now, imagine that different users schedule the same report but with different parameters to run at the same time. We would then have multiple calls to the Telerik.Reporting.Processing.ReportProcessor.Render method from different threads, passing to each call a different instance of the same Telerik.Reporting.Report class. It seems that there are some problems with this scenario. The reports will be rendered, but some of them with errors like "An error has occured while processing TextBox 'TextBox1': Index was outside the bounds of the array.".

I believe that thread safety is a very important functionality, therefore I hope you have a workaround for this or at least consider fixing it as soon as possible.

Regards,

Daniel

Steve
Telerik team
 answered on 30 Sep 2009
3 answers
149 views
Hi,

Since Telerik chart presently not supporting changing series item colors at run when datasource is set, I populated the series and series items with colors at run time with out data source.

Problem: Not able to set X axis labels. The following is the code I have written.

Please help me regarding this.



public static void FillAvgGraph(Telerik.Reporting.Processing.Chart chart, List<AvgPercentGraph> list)
        {
           
            Chart definition =(Chart) chart.ItemDefinition;
            //chart.DataSource = list;
            ChartSeries series = new ChartSeries();
            series.Name = "Percent";
            //series.Type = ChartSeriesType.StackedBar100;
            series.DataYColumn = "Percent";
            definition.Legend.Appearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.Bottom;
            ChartAxisItemsCollection labels=new ChartAxisItemsCollection();
            int index = 0;
            foreach (AvgPercentGraph data in list)
            {
                ChartSeriesItem seriesItem = new ChartSeriesItem();
                seriesItem.Name = data.Name;
                seriesItem.YValue = (double)data.Percent;
                seriesItem.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Black;
                seriesItem.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
                if(data.Percent < 58)seriesItem.Appearance.FillStyle.MainColor = Color.Red;
                else if (data.Percent > 58 && data.Percent < 76) seriesItem.Appearance.FillStyle.MainColor = Color.Yellow;
                else if (data.Percent > 76 && data.Percent <= 100) seriesItem.Appearance.FillStyle.MainColor = Color.Green;
                series.AddItem(seriesItem);
                ChartAxisItem item = new ChartAxisItem(data.Name);
                labels.Add(item);
                
                
            }
           
            series.DefaultLabelValue = "#Y" + "%";
            
            // series.Appearance.LabelAppearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
            // series.Appearance.LabelAppearance.FillStyle.MainColor = Color.Red;
            definition.Series.Clear();
            definition.Series.Add(series);
           // definition.Series[0].PlotArea.XAxis.DataLabelsColumn = "Name";
           
              definition.Series[0].PlotArea.YAxis.AddRange(0,100,20);
              definition.PlotArea.XAxis.Items.AddRange(labels.ToArray());
            
           

        }

Sridhar Bolisetti
Top achievements
Rank 1
 answered on 30 Sep 2009
1 answer
334 views
Hi,

I have deployed  my application in IIS7.0 (windows 2008). I am using Telerik Reporting. I have registered the Telerik.ReportViewer.axd  in web.config as follows.

<system.webServer>  
    <validation validateIntegratedModeConfiguration="false"/>  
    ......  
    ......  
    ......  
    <handlers>  
      <remove name="WebServiceHandlerFactory-Integrated"/>  
      <remove name="ScriptHandlerFactory" />  
      <remove name="ScriptHandlerFactoryAppServices" />  
      <remove name="ScriptResource" />  
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"  
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"  
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd"  
           type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />  
      
      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*"  
           type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"  
           preCondition="integratedMode,runtimeversionv2.0" />  


    </handlers>  
  </system.webServer> 

Eventhough it showing the following error.

The http handler needed by the Report Viewer has not beenregistered in the application's web.config file.  Add <add verb="*"path="Telerik.ReportViewer.axd" type ="Telerik.ReportViewer.WebForms.HttpHandler,Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral,PublicKeyToken=a9d7983dfcc261be" /> to the system.web/httpHandlerssection of the configuration file.

kindly tell me a solution.

Thanks & Regards,
Jones
Steve
Telerik team
 answered on 30 Sep 2009
1 answer
136 views
I have generated some subreports with some of my newbie code.  However, they overlap and i have read about making them none zero ni hieght but can not get this to work.

 

Public Sub New()

 

InitializeComponent()

 

Dim mobjCert As New objCertificate(mJobNumber)

 

 

Dim MySubReport As Telerik.Reporting.SubReport

 

 

Dim mobjTemplate As New objTemplate(mobjCert.TemplateCode)

 

 

For tempcounter As Int16 = 1 To mobjTemplate.Count

 

    AddTestSubReports(MySubReport, mobjTemplate.TestCode(tempcounter - 1),

"Test " + tempcounter.ToString + " " + mobjTemplate.TestTitle(tempcounter - 1))

 

 

Next

 

 

End Sub

 

 



Private
Sub AddTestSubReports(ByVal MySubReport As Telerik.Reporting.SubReport, ByVal mTestCode As String, ByVal mTestTitle As String)

 

MySubReport =

New Telerik.Reporting.SubReport

 

MySubReport.Size =

New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(15.082725524902344, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(1.7001994848251343, Telerik.Reporting.Drawing.UnitType.Cm))

 

MySubReport.Style.Padding.Bottom =

New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)

 

MySubReport.Dock = System.Windows.Forms.DockStyle.Top

MySubReport.Top =

New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm)

 

MySubReport.Name =

"SubReport2"

 

MySubReport.Style.BorderColor.Default = System.Drawing.Color.MidnightBlue

MySubReport.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid

MySubReport.Style.Color = System.Drawing.Color.Transparent

 


Dim
mobjTestTest As New objTestTest(mTestCode)

 

 

Dim mobjHeaders As New objTestHeading(mTestCode)

 

 

Dim txtTemp As New Telerik.Reporting.TextBox

 

 

Dim SubRep As New CertificatTestSubRep1

 

MySubReport.ReportSource = SubRep

SubRep.txtTestName.Value = mTestTitle

DeleteUnwantedSubRepItems(mobjHeaders.Count, SubRep, mobjHeaders)

SubRep.DataSource = mobjTestTest.dtTestTest

 

Me.DetailSection1.Items.Add(MySubReport)

 

 

End Sub

many thanks

Alo

 

Steve
Telerik team
 answered on 29 Sep 2009
1 answer
83 views
I'm trying to figure out how to have my properties populate correctly.  This all works fine in my test project, but when I try to incorporate the reports into my regular project, which uses SQLServer as the SessionState mode, the properties are no longer populated.   In addition, the EmailPromotionReport() is fired twice.   How can I set this up properly?  Thanks.

Report Code:
 public int advertiserID { getset; }  
        public DateTime startDate { getset; }  
        public DateTime endDate { getset; }  
 
        public EmailPromotionReport()  
        {  
            /// <summary>  
            /// Required for telerik Reporting designer support  
            /// </summary>  
            InitializeComponent();  
            this.NeedDataSource += new System.EventHandler(this.EmailPromotionReport_NeedDataSource);  
 
            
        }  
 
 
        private void EmailPromotionReport_NeedDataSource(object sender, EventArgs e)  
        {  
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;  
            report.DataSource = (FarranMedia.Classes.Promotions.GetMailingsByAdvertiser(advertiserID,startDate,endDate)).Tables[0];  
        } 
   
Calling report code:
Reporting.EmailPromotionReport reportBlast = new Reporting.EmailPromotionReport();  
                reportBlast.advertiserID = advertiserID;  
                reportBlast.startDate = Convert.ToDateTime("1/1/07");  
                reportBlast.endDate = DateTime.Today;  
                ReportViewer1.Report = reportBlast; 

Steve
Telerik team
 answered on 29 Sep 2009
0 answers
203 views
Hi,

I have deployed  my application in IIS7.0 + windows 2008. I am using Telerik Reporting. I have added the following in web.config.

<httpHandlers> 
      <remove verb="*" path="*.asmx"/> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
 
      <add path="Telerik.ReportViewer.axd" verb="*" type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" /> 

    </httpHandlers>
    ....... 
    .......
    .......
    .......
<system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    ...... 
    ...... 
    ...... 
    <handlers> 
      <remove name="WebServiceHandlerFactory-Integrated"/> 
      <remove name="ScriptHandlerFactory" /> 
      <remove name="ScriptHandlerFactoryAppServices" /> 
      <remove name="ScriptResource" /> 
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" 
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" 
           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" 
           type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" 
           type = "Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" 
           preCondition="integratedMode,runtimeversionv2.0" /> 
    </handlers> 
  </system.webServer> 

I am getting the following error.

The http handler needed by the Report Viewer has not beenregistered in the application's web.config file.  Add <add verb="*"path="Telerik.ReportViewer.axd" type ="Telerik.ReportViewer.WebForms.HttpHandler,Telerik.ReportViewer.WebForms, Version=2.9.9.202, Culture=neutral,PublicKeyToken=a9d7983dfcc261be" /> to the system.web/httpHandlerssection of the configuration file.


Is the tag added in <handlers> was wrong?

Kindly tell me a solution.


Jones
Top achievements
Rank 1
 asked on 29 Sep 2009
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?