Telerik Forums
Reporting Forum
2 answers
284 views
Hi.

Within my details section, I wish some of the reportitem properties to be written out as a table.
The data source is ObjectDataSource (clr object).

If I have a datasource like this

class DetailObject
{
public int Prop1 {get;set;}
public int Prop2 {get;set;} 
public int Prop3 {get;set;} 
public int Prop4 {get;set;} 
public int Prop5 {get;set;} 
public int Prop6 {get;set;}  
}

I want properties 1,2 and 4 to be written out as a table within the details section and 3 and 5 in another table.
I am faced with the problem that tables need to be bound to collections. Leaving the datasource empty or binding to "= ReportItem" causes the table not to render at all (instead of rendering one and allow direct access to reportitem properties).

The workaround appears to be to create a value object that matches the the table layout and fake a list. Like this:

class Table1Values
{
public int DetailProp1 {get;set;}
public int DetailProp2 {get;set;} 
public int DetailProp4 {get;set;}  
}

class Table2Values
{
public int DetailProp3 {get;set;}
public int DetailProp5 {get;set;} 
} 

And then expand my DetailObject class with an Enumerable like this:

class DetailObject
{ 
// ( all the other stuff) 

public IEnumerable Table1Data {
get {
yield return new Table1Values
{ DetailProp1 = Prop1, 
DetailProp2 = Prop2,
DetailProp4 = Prop4
};
}};
}

Then it is possible to bind a table datasource to "=Fields.Table1Data" and binding cells to DetailProp1, DetailProp2 and DetailProp4. 

Am I missing something obvious, or is this how one should go about creating a table within the details section where the table is a table layout of predetermined individual ReportItem properties?
Tormod
Top achievements
Rank 1
 answered on 25 Sep 2012
16 answers
1.6K+ views
Hi - 
I'm trying out Telerik Reporting for the first time (I have used SSRS for a few years before). 

There's a few useful expressions that I've used in SSRS, which I have trouble reproducing in Telerik reports...

1) Referencing a dataset with the Exec() function:
 - I have a table "TableA", and a TextBox outside of the table
 - I would like the TextBox value to be the Sum() from TableA =  Exec('TableA', Sum(Fields.Column1))
 - unfortunately this is not supported...  Any plans to have it in the future?  What's the cleanest workaround?

2) Referencing the value from another TextBox:
 - I have 2 Textboxes, "TextBoxA" and "TextBoxB"
 - I would like TextBoxB value to equal the value from TextBoxA (in SSRS I would do: ReportItems!TextBoxA.Value )
 - this doesn't seem to be supported...  Any plans to have it in the future?  What's the cleanest workaround?

3) ColumnNumber() function:
 - I was trying to use ColumnNumber() in a header for some business scenario
 - the function always returned "1"...

thanks for your help!
 - bash
Ubuntu
Top achievements
Rank 1
 answered on 24 Sep 2012
13 answers
2.9K+ views
What is the method for setting the data source for subreports?

I currently have a report with 2 subreports. At runtime I set the report's data source to a DataSet. I also set the data source for the 2 subreports to the same DataSet. No data appears to be getting to the subreports.

public PeakReport(DataSet ds)
{
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();

            DataSource = ds;

            subAMDaily.Report.DataSource = ds;
            subPMDaily.Report.DataSource = ds;
}
Elian
Telerik team
 answered on 24 Sep 2012
4 answers
258 views
Hello,
 I am new in telerik. I would like to figure data + collection in one Report from my Bussiness object.

for example (it is only example but it describes my situation):

I have this classes:

public  class  Thing
{
     public string Name {get; set;}
     public string Price {get; set;}
}

public class  Person
{
 public string Name {get; set;}
 public string SurName{get; set;}
 public List<Thing> Things{get; set;}
}

result should be something like this:
--------------------------
name + surname  John Novak
things
 Car $100
 Toilet paper 42
 Mask $20
--------------------------

My question is, how do I figure out information about one person and person's things at the one report. I investigated "Telerik reporting tep by step" guide, but it deals only with database.

I am creating PDF from my bussiness object and I really don't know how to bind subreport.  I investigated that I can use subreports: Master report will show name + surname and subreport will show things.
Question is how to fill DataSource of  subreport.

My method for creating report is :

 

var dp = new DataProvider();

 

 

var myReport = new Report1();

 

myReport.DataSource = dp;
//!!!! Is tehere way, how to say, that Report2 (which is subreport in Report 1) will be filled by dp.SomeCollection

 

string mimType = string.Empty;

 

 

string extension = string.Empty;

 

 

Encoding encoding = null;

 

 

byte[] buffer = Telerik.Reporting.Processing.ReportProcessor.Render(

 

 

"PDF", myReport, null, out mimType, out extension, out encoding);

 

 

FileStream fs = new FileStream("c:\\reportWithExternalDataSource.pdf", FileMode.Create);

 

fs.Write(buffer, 0, buffer.Length);

fs.Flush();

fs.Close();


I hope I described my problem. Can anybody help me please.


thanks

kure256

Kalpesh
Top achievements
Rank 1
 answered on 24 Sep 2012
16 answers
530 views
Hi there,

I have juts one solution where I have to compute a lot of data.
After computing I have a lot of lists I want to display in a report.
My object looks like this:
--------
List of objects | (contains) =>
                       |- List of StatusData
                       |- List of PowerData
                       |- List of ReferenceData
                       |- List of Curves

What do you thing is the best practice to get this data in different tables?

Best Regards
Manfred
Roland
Top achievements
Rank 1
 answered on 24 Sep 2012
1 answer
245 views
Hi..
We created labels with background image.
When exported on our dev machine it looks fine.
On the server or a user's machine the labels are all blurry when exporting to PDF.
We are using the WPF Report viewer.
Export to other formats works fine.
any ideas?
thx
Steve
Telerik team
 answered on 24 Sep 2012
1 answer
152 views
I have a crosstab table that I am binding to "Samples". Each sample has a date, I order these coming out of sql from oldest to newest (ie 01/01/11 comes before 02/01/11).

I have verified my IEnumerable is ordered correctly, as shown by the attached screenshots (photo1 & photo2). But when the report is generated, it does not order it correctly (photo3 & photo4). It also ignores the order of a DataTable (photo5)

Why is it ignoring the order of my datasource? Any ideas?

Thanks
IvanY
Telerik team
 answered on 21 Sep 2012
4 answers
469 views
Hai,

I have created one Telerik Report. I set the height of the report viewer as 100% in aspx page. In my development PC, it is showing properly. But in deployment, it shows only 40% of the screen height. There is a scroll bar to scroll down evenif the data is small to display on one page. No need to show the scrollbar, if the data can be shown on one page. I have attached the screenshot of the page. Please send me a solution as soon as possible. Its very urgent..Please.

Thanks & regards,
Regeesh Joseph
Paul R.
Top achievements
Rank 1
 answered on 21 Sep 2012
21 answers
1.9K+ views
I need to show/hide certain table columns based on values of other columns, at runtime. Can a table column including header and detail row be hidden entirely? I am able to not display the column, but I need it to collapse as though it were not there at all.
Steve
Telerik team
 answered on 21 Sep 2012
1 answer
235 views
After the recent update to reporting I'm seeing a NullReferenceException when loading a ReportViewer whose ReportSource hasn't been set. My particular use case is that I dynamically create reports based on user input and set the ReportSource through data binding. This means that the report source will be null until the user hits my "generate" button. This is an issue that is a show stopper for a release next week, so any sort of quick help that someone can provide would be greatly appreciated. 

To reproduce you simply need to load any view that has a ReportViewer whose ReportSource hasn't been set.

Here is the stack trace:

   at Telerik.ReportViewer.Wpf.ReportViewerModel.CreateReportSourceSnapshot()
   at Telerik.ReportViewer.Wpf.ReportViewerModel.CreateHistoryRecord(Boolean isTemporary)
   at Telerik.ReportViewer.Wpf.ReportViewerModel.LogHistory(LogHistoryRecord logHistory, Boolean logTemporaryHistoryRecord)
   at Telerik.ReportViewer.Wpf.ReportViewerModel.RefreshReportInternal(Boolean reloadParameters, LogHistoryRecord logHistory, Boolean resetCachedResults)
   at Telerik.ReportViewer.Wpf.ReportViewerModel.RefreshReport()
   at Telerik.ReportViewer.Wpf.ReportViewer.RefreshReport()
   at Telerik.ReportViewer.Wpf.ReportViewer.OnLoaded(Object sender, RoutedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at MS.Internal.FrameworkObject.OnLoaded(RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Steve
Telerik team
 answered on 21 Sep 2012
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?