Telerik Forums
Reporting Forum
2 answers
127 views
Hi I'm working on a webproject and using telerik reporting to display custom reports.

I have the following Solution Structure..

-Solution
 + Web Project (Web)
 + Class Library (Reports)

I have designen a report that takes dynamic parameters and builds multivalue parameters from what has prev been selected.

So in the report i have a first parameter Page, page is not a multivalue. When a page is selected say you select ID 5, the second parameter takes the selected value and calls and stored procedure with the first parameters value as a parameter passed to the sp. Here everything is ok. However when it comes to the second parameter which is a multivalue. I have choosen so that the third parameter takes the selected values of the second and calls an sp with the values. To get the values i am using a userfunction like below
public static string FormatArray(object[] array)
       {
           StringBuilder sb = new StringBuilder();
           foreach (object o in array)
           {
               if (sb.Length > 1)
               {
                   sb.Append(", ");
               }
               sb.Append(o.ToString());
           }
           return sb.ToString();
       }

In the Report Preview & Html Preview this works perfect and everything is displayed and bound as it should be..

However when migrating this report to my web solution I have the following setup.

Enheter.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Enheter.ascx.cs" Inherits="Web.controls.Reports.Enheter" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=5.0.11.316, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<telerik:ReportViewer ID="ReportViewer1" runat="server" Width="100%" Height="700px"
   >
</telerik:ReportViewer>



Backend

 
Report myReport = new Rapporter.K2.Report1();
 
                myReport.ReportParameters["nkod"].Value = nkod;
                myReport.ReportParameters["sysID"].Value = BaseLogic.GlobalSystemID.intSystemID;
                using (CoreEntities db = new CoreEntities(clsBaseLogic.SqlConnEntityString))
                {
                    myReport.ReportParameters["strEnhet"].Value = db.tblTree_item.SingleOrDefault(k => k.intTreeItemID == nkod).strTreeItem;
                    myReport.ReportParameters["strPeriod"].Value = db.tblCore_Period.SingleOrDefault(k => k.intPeriodID == BaseLogic.intPeriodID).strDescription;
 
                }
                ReportBook book = new ReportBook();
                book.Reports.Add(myReport);
                ReportViewer1.Report = book;


This is just because I want to set some parameters before making the report..


Everything shows up as it should but when trying to select a value inside my second parameter , the third parameter who uses my userfunction displays the following error.

The expression contains undefined function call FormatArray().
 
at Telerik.Reporting.Expressions.FunctionNode.Eval(Object row, Object context)
at Telerik.Reporting.Processing.Data.MultidimensionalQueryProvider.Evaluate(Object value, Object data)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.GetEvaluatedParameters()
at Telerik.Reporting.Processing.Data.SqlQueryProvider.GetCommandParameters(Boolean evaluateParameters)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateCommand(IDbConnection connection, Boolean evaluateParameters)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateCommand(IDbConnection connection)
at Telerik.Reporting.Processing.Data.SqlDataEnumerable.d__0.MoveNext()
at Telerik.Reporting.Processing.Data.ResultSet.SeedData(IEnumerable`1 rawData)
at Telerik.Reporting.Processing.Data.ResultSet.Fill(IEnumerable`1 data)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.Execute(MultidimensionalQuery query)
at Telerik.Reporting.Processing.ParametersManager`1.GetAvailableValuesData(ReportParameterAvailableValues availableValuesDef, ExpressionNode valueExpression, MultidimensionalQueryProvider& provider)
at Telerik.Reporting.Processing.ParametersManager`1.CalculateParameterValues(T parameter, ReportParameter parameterDef, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.Calculate(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.CalculateChildren(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.Calculate(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.CalculateChildren(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.Calculate(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.GetParameters(IDictionary`2 parameterValues)
at Telerik.ReportViewer.WebForms.ParametersPage.OnLoadComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

the third parameter datasource is an sp with the following parameters inserted -> = FormatArray(Parameters.survFieldsGroup.Value)
Parameters.survFieldsGroup being the second parameter.

It seems the report doesnt know where the userfunction is when it has been migrated to the reportbook.

How can i fix this?

Anders
Peter
Telerik team
 answered on 31 Mar 2011
2 answers
294 views
Hi

We're creating a reporting application that uses a shared external style sheet across a number of reports.

I'd like to create a report that lists all the styles in the stylesheet - I thought I'd try something like this in the report constructor (pseudo code only):

Add the stylesheet file to the reports
Use the collection of styles as an object data source
Create a conditional formatting rule that uses a named style for each row.

I can't find a way to enumerate the styles that are added by external style sheet - this is my code in the report constructor:

ess = new ExternalStyleSheet(path);
ExternalStyleSheets.Add(ess);
 
foreach (StyleRule style in StyleSheet)
{
    //do something with styles;
}

no styles are found by the foreach loop...

Am I doing something wrong? Can my approach work?

thanks
Andy
Andy
Top achievements
Rank 1
 answered on 31 Mar 2011
1 answer
1.5K+ views
Hi,

What is the property that needs to be set in order to position a pie chart near the left of the plot area?  Right now my pie chart is positioned in the centre of the plot area and is sometime overlapped by the legend.

So basically I want to move the pie chart image itself to the left inside the plot area allowing for more room to display the legend.

Thanks for any help.
Peter
Telerik team
 answered on 31 Mar 2011
5 answers
136 views
Good Day All

I have a strange thing happening in my project. i have a report that retrieve the barcode info based on a certain criteria. The data gets filtered and it get displayed. but this value is the Value that is assigned to a barcode from the database. now on design and preview it shows the barcode,  but when i run it in my app, it only shows the code number from the database not the barcode and the number as depicted in the preview. what is the problem. i have attached the properties of the barcode on design mode.

Vuyiswa
Top achievements
Rank 2
 answered on 31 Mar 2011
3 answers
84 views
I have a simple report that has 4 columns.
Section, Subsection, Mandatory, and detail.

The report is grouped by the Section, Subsection, and Mandatory fields.

The page breaks and the report looks as I want it on the preview in the design but it has different page breaks in the HTML preview. And if the actual running of the code, the detail data looks good but the Section and Subsecition never change.

I am using VS 2010,with C# and the most current version of Telerik Reporting. This is an ASP application. Any ideas on how to fix this?
Hrisi
Telerik team
 answered on 31 Mar 2011
8 answers
108 views
Good Day All

i am using Silverlight Reporting. i have tried to follow the demo example many times , just to display a barcode report that is not even connected to the database, but i could not. I have attached the example project that fails. So basically i have a class library that has a report and and i have a Silverlight app that has a asp.net or html project that host the silverlight, and i have created a service from the web app and and i have referenced the report from there. but still the barcode dont show.

Please find the attached project

http://www.vuyiswamaseko.com/Report2.zip

Thanks
Vuyiswa
Top achievements
Rank 2
 answered on 30 Mar 2011
1 answer
249 views
Hi,
I have some problem using crosstab to display the percentage of number of items against the total of each group. Right now it's calculating agains the total count of the entire report.
Attach is my screenshot with explaination.

Thanks
Quan Nguyen
Peter
Telerik team
 answered on 30 Mar 2011
5 answers
762 views
Hi,
I have a some list boxes on a ASP.NET page were I can filter my report.
After I made my choices I click the submit button and render the report.

Now I want to print all the filtered items on a new blank page at the end of the report.
Is it possible to add a new blank page to the report and print the item names there?

My first thought was to use a sub report and place it on the reports page footer section but the designer want let me so I guess it's not possible!?
(I could place the items directly on the page footer section but I have a couple of reports with equal filter options so I wanted to use some kind of include)

Regards,
Mattias

Peter
Top achievements
Rank 1
 answered on 30 Mar 2011
7 answers
216 views
Hi,
I'm trying to setup reportViewer for my silverlight project. I'm using Telerik Reporting Trial version so far. I built a simple report which just gives me the correct data preview as expected. Now I'm trying to set up that report for my silverlight application so that I might see it in the reportviewer. for that I've also implemented ReportService configurations.
here
<Grid x:Name="LayoutRoot" Background="White">
        <telerik:ReportViewer
              ReportServiceUri="../ReportService.svc"
              Report="TelerikTrialReportSample.TrialReport, TelerikTrialReportSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
        </telerik:ReportViewer>
    </Grid>

Now I expect this to display me the TrialReport [ which shows me the correct data preview at least]. But when I run this solution i only get this error being displayed in the ReportViewer control.

There is no available report type with assembly qualified name 'TelerikTrialReportSample.TrialReport, TelerikTrialReportSample,                        Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load file or assembly 'TelerikTrialReportSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.


Although, TelerikTrialReportSample lies with the same solution and TrialReport already has been given a qualified name. I've verified assembly version number as well. And still getting this error. Can someone guide me what did I miss or which side I should try to debug it further.
Igor
Top achievements
Rank 1
 answered on 29 Mar 2011
1 answer
81 views
Hy,

i'm working with Telerik Reporting and have some problems. I create one master report where i have report parameters and a header of the page. After user selects values for parameters (2x datetime, 4x Integer, 1x Boolean) i want to show right SubReport (if true then subreport1 else subreport2). Those two subreports use 6 parameter values from master report parameteres and I pass those values to SqlDataSource in each subreport.

If I delete one SubReport field my report works as it should. But if I have two SubReport fields on master report i get "Object reference not set to an instance of an object." I dont have any idea what i'm doing wrong.

I have test each subreport in designer and datasource are ok. In master report i have two DataBound methods where I set Visible to true or false which subreport to show.

public static bool subMeseci = true;
 
private void subReport_PoMesecih_ItemDataBound(object sender, EventArgs e)
        {
             
            subMeseci = (bool)this.ReportParameters["months"].Value;
            if (subMeseci)
                (sender as Telerik.Reporting.Processing.SubReport).Visible = true;
            else
                (sender as Telerik.Reporting.Processing.SubReport).Visible = false;
             
        }
 
        private void subReport_Vse_ItemDataBound(object sender, EventArgs e)
        {
             
                subMeseci = (bool)this.ReportParameters["months"].Value;
                if (subMeseci)
                    (sender as Telerik.Reporting.Processing.SubReport).Visible = false;
                else
                    (sender as Telerik.Reporting.Processing.SubReport).Visible = true;
        }

I also set all 6 parameters that i use in subreport datasource.

I have attached two photos (one is my master report wher i have two subreports in detail section, and other shows report parameters that i pass to subreport).

First I was thinking that i do something wrong when i'm passing parameters to subreport but as i mentioned in the begining if i delete one subreport field from master report it works ok.

Sorry for my english but i hope you get the point what my problem is.
Peter
Telerik team
 answered on 29 Mar 2011
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?