Telerik Forums
Reporting Forum
1 answer
166 views
Hi,
I have the following statements in my report codebehind ( NeedDataSource) :

 

IEnumerable kl;   
kl =(IEnumerable)Report.ReportParameters[0].Value;   
List<string> ls = new List<string>();   
foreach (IEnumerable ie in kl)  
 
ls.Add((string)ie);   
}

It works fine.
But if this report is executed as a subreport from another Report i have :
Unable to cast object of type 'System.Char' to type 'System.Collections.IEnumerable'.
on foreach line.

so i tried :
IEnumerable kl;   
kl =(IEnumerable)Report.ReportParameters[0].Value;   
List<string> ls = new List<string>();   
foreach (var ie in kl)  
{  
ls.Add((string)ie);   
}

same problem, but now i can see the value of ie is the first char of the current kl element,
that is if the kl element is "Bye" ie value is "B". Then is obvious i get a casting eroor.
But why i have a different behaviour (report, subreport) and how to solve it?
Any idea?





Steve
Telerik team
 answered on 15 Jun 2011
3 answers
637 views
Hi,

I was looking through the forums, demos, and online documentation and could not find any details on how to access DataItems in a ItemDataBound event handler. I have a dataset bound to the report's datasource. One of the data items has the name of a gif to use for the column. So I need to get the data item, get the name and bind it to the column in the report. I hope that's clear. It would be nice to have more robust documentation regarding the event handlers.

Thanks,
Bruce
Steve
Telerik team
 answered on 15 Jun 2011
1 answer
116 views
Hello, 


I'm trying the transition from TelerikReporting Q3 2009 to Q1 SP1 2011 version. In my code I'm creating a Table Dynamically and Databinding it. 

Which results in the following exception:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Reporting.Processing.Table.MeasureColumns(Graphics graphics) +299
   Telerik.Reporting.Processing.Table.Measure(MeasureDirection dir, Graphics graphics) +58
   Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics) +136
   Telerik.Reporting.Processing.ProcessingElement.Measure(MeasureDirection dir, Graphics graphics) +1467
   Telerik.Reporting.Processing.ReportSectionBase.Measure(MeasureDirection dir, Graphics graphics) +40
   Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics) +136
   Telerik.Reporting.Processing.Group.MeasureElement(MeasureDirection dir, Graphics graphics) +248
   Telerik.Reporting.Processing.Report.MeasureElement(MeasureDirection dir, Graphics graphics) +377
   Telerik.Reporting.Processing.Report.MeasureElement(ProcessingElement elementToMeasure) +204
   Telerik.Reporting.Processing.Report.OnItemProcessed() +56
   Telerik.Reporting.Processing.ReportItemBase.Process(DataMember data) +653
   Telerik.Reporting.Processing.Report.Process(DataMember data, DataItemState state, Boolean interactivityEnabled, Boolean documentMapEnabled) +123
   Telerik.Reporting.Processing.ReportProcessor.ProcessReport(IReportDocument reportDocument, IDictionary processingContext) +1195
   Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback) +486
   Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageIndex) +900
   Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperationOverride() +261
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(NameValueCollection urlQuery, HttpContext context) +77
   Telerik.ReportViewer.WebForms.HttpHandler.ProcessRequest(HttpContext context) +202
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
 

Any help would be Greatly Appreciated.


Thanks in advance.

Steve
Telerik team
 answered on 15 Jun 2011
1 answer
194 views
I have a report that I created using the wizard. I set everything up to display the report in Landscape mode. When I preview the report, it always displays in Portrait mode. When I click on the page settings, it tells me that no printers are installed ( I have many printers installed). When I click on page settings again, it allows me to change to Landscape mode. If I export the report to Adobe, it exports in portrait mode also.

How can I set the report to preview and export in the correct orientation?
Steve
Telerik team
 answered on 15 Jun 2011
1 answer
112 views
Hi,
Can I adjust this so the text doesn't wrap on the page size like it does in the image?

Regards,
Mattias
Steve
Telerik team
 answered on 15 Jun 2011
1 answer
155 views
Hi,

Can anyone tell how to implement Group By on datatables using linq in telerik (C# Application).
I have written query as follows:

var query = from 

 

 

dataitem in combinedDataTable.AsEnumerable()  

 

 

 

group dataitem by dataitem.Field<string>("IONumber") into r

select new  

 

 

 

{

IONumber = r.Field<

 

string>("IONumber"),
IOName = r.Field<string>("IOName")
}

I am getting error on 'group' saying:
'Telerik.Web.UI.GridDynamicQueryable.GroupBy(System.Linq.IQueryable, string, string, params object[])' is inaccessible due to its protection level

Can anyone suggest how to update this query to work fine? (I am using telerik 2009)

 

 

 

 

 

 

Veli
Telerik team
 answered on 15 Jun 2011
1 answer
118 views
Hi,
about this subject i have read some trhead in this forum but  could'nt find a solution for my problem.

Here the problem:
i manage the parameter by the build in Ui for parameter, My parameter is setted as multivalues.
Now i would like to get  the values  choosen by the user.

Documetation and intellisense, about ReportParameter.value property, says :
"Gets or sets the value of the parameter. Can be an Expression that evaluates to an object, value of the allowed types, or [!:IEnumerable] containing values of the allowed types. "

But ReportParameter.value  is an object and does'nt expose an enumerator. In same place i read it is an ArrayList so i tried something like that:
ArrayList kl= new ArrayList();
 kl =Report.ReportParameters[0].Value;

and i get the above error:
Unable to cast object of type 'System.Object[]' to type 'System.Collections.ArrayList'.

No matter what typ of collection i tried with( Ilist,List). I get always a casting error.

So i can retrieve the list of values of a multivalues parameter?

Thanks




ciccio
Top achievements
Rank 1
 answered on 15 Jun 2011
1 answer
445 views
I have a very simple report, that pulls from a sample database with no NULL values. I have the report working fine, and have added a parameter and a filter to filter by user name.

I would like the option of running the report for all names. I changed the "AllowNull" value to true. When I try to run the report, I get the following error:

An error has occurred while processing Report 'talksafe1':
Object cannot be cast from DBNull to other types

How do I run both filtered and unfiltered data? Again, I have no NULL values in my database, it only contains 4 records.

=Fields.Manager =  =Parameters.ManagerPrm.Value

AllowBlank = True
AllowNull = True
DataSource = SQLDatasource1
DisplayMember = Fields.Manager
ValueMember = Fields.Manager
Name = ManagerPrm
Text = Select Manager
Type = String
Visible = True
Steve
Telerik team
 answered on 15 Jun 2011
6 answers
481 views
Telerik Reporting
Hello,
    I'm using Telerik report, I want to export to PDF file and send email to group of customers. When the report is expored to pdf, the file size is always 1MB (or more)
    My question is how i can decrease the file size? it's importance per customer requests.

Please Help and Thanks,
Joe
Steve
Telerik team
 answered on 15 Jun 2011
0 answers
155 views
Hi everyone,

I am trying to make arithmetic operation with two fields from two different datasources in a textbox. One of the datasources (A) is datasource of the report and show the fields in the detail section. Another one (B) returns just one row.
In the footer section, I have to make addition with B and sum of A.

Any suggestions ?
Bekir
Top achievements
Rank 1
 asked on 15 Jun 2011
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?