Telerik Forums
Reporting Forum
1 answer
436 views

Hi All,

I wanted to pass the viewmodel to report viewer in Reportview.cshiml. but I havn't got any such examples . always seeing the example on to bind the datasource in the ReportController . binding data source from report controller working as expected but looking for help on the view model binding in Razor Syntax.

 

My Cshtml Code

 

@using ReportingLibrary
@using Telerik.ReportViewer.Mvc
@using CPGUX.ProjectManagement.Core.Entities
@using CPGUX.Utility.Helpers
@model IEnumerable<ProjectDetails>

 

@(Html.TelerikReporting().ReportViewer()
 .Id("reportViewer1")
 .ServiceUrl(Url.Content("~/api/reports/"))
 .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-FA.html"))
 .ReportSource(new Telerik.Reporting.TypeReportSource() { TypeName = typeof(CPGUX.ReportingLibrary.AllProjectsByUser).AssemblyQualifiedName })
 .ViewMode(ViewMode.Interactive)
 .ScaleMode(ScaleMode.Specific)
 .Scale(1.0)
 .PersistSession(false)
 .PrintMode(PrintMode.AutoSelect)
 .Deferred()
)

 

 

ReportController.cs

 

public Telerik.Reporting.ReportSource Resolve(string report)
{
Report reportInstance = null;
if (report.Contains("AllProjectsByUser"))
    {

       string result = _projectController.GetProjectNumberSession();// new ProjectController().GetProjectNumberSession();
      reportInstance = new AllProjectsByUser();
      reportInstance.DataSource =  _projectService.FindProjectsByUser(IIdentityUser, 100, 0); // don't want to call instead of binding should haven in viewer itself

    }

}

 

Stef
Telerik team
 answered on 25 Jan 2017
1 answer
361 views

I am beginner in Telerik Reporting. I have created an Telerik Report by Telerik Report Q1 2016 Wizard. The designer is showing report well but when i attach it with Telerik Report Viewer it gives following error:

 

"an error occured while processing Table 'table1':

Unable to establish a connection to the database. Please, verify that your connection is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your aplicaion.

--------InnerException---------

Format of the initialization string does not conform to specification starting at index 0."

 

My code is:

 private void ReportViewerForm1_Load(object sender, EventArgs e)
        {
            Report1 rp = new Report1();
            reportViewer1.Report = rp;
            
            this.reportViewer1.RefreshReport();
        }

 

Stef
Telerik team
 answered on 25 Jan 2017
2 answers
153 views

Hi to all,

I have a report that has a single ObjectDataSource called CustomerObjectDataSource, this object gives an object of type CustomerReportModel, this one has 2 object CustomerModel and CompanyInformationModel (last one for header title information).

Now CustomerModel has a property that gives List<ConditionModel> that has Date and Description properties.

My report shows CustomerModel properties by "Fields.Propxxxx", I added a Table that I connected through binding DataSource of table using "Fields.Customer.ConditionsList", (I tested that a runtime, ConditionList is valued).

I setted table cells with format "ReportItem.DataObject.RawData.PropOfMyCollection" where PropOfMyCollection is VariationDate and Description.

When I try to render my report table not appears.

Where I wrong?

Stef
Telerik team
 answered on 25 Jan 2017
2 answers
108 views

Is there a way to set the data source of a report to an Entity Data Source that does NOT point to a specific entity?  I have a report that I am trying to generate but the report requires data from multiple entities, and I would prefer not to have a sub-report of sub-reports, so I was wondering of there was a way to set the data source to multiple entity objects?  If this doesn't make sense or you need any further explanation please let me know.  Any information would be appreciated.

Katia
Telerik team
 answered on 25 Jan 2017
6 answers
651 views
Hello,
I've been using RadTreeView with great success in my project. And, now I need to show the underlaying tree view data structure in a report. I'm planning to use telerik Reporting to do this.

I'm new to telerik reporting, so my question is: Is it possible to show tree structure using the reporting tool? The database structure is similar to the tree.mdb from RadTreeView demo here: databinding radtreeview
It's a simple table with id and parent id columns.

And, if this is possible, where do I start? What parts of the reporting tool should I use?

Thanks!
Stef
Telerik team
 answered on 24 Jan 2017
1 answer
220 views
Hi,
I've seen the forum post of how to export a reportbook to a pdf file. However, I can't export my report book correctly.
I have two (or more) reports with subreports on the detail. My collection of reports belongs to the same report class  - DanfeReport(which inherits from Telerik.Reporting.Report). 
I have included all reports in ReportBook and rendered into a pdf result. Then I wrote it into a file, using Filestream.
The document was created with 2 pages as expected, but the content was incorrect because both pages have the same content. 
Can you help me?
Thanks in advance.
Stef
Telerik team
 answered on 24 Jan 2017
8 answers
974 views

Hi to all,

I have a solution with several projects: Client, Entities and Reports.

The last one doesn't see Entities assembly. Then I added Assembly reference, but this code it seems take not effect.... where I wrong?

<configuration>
  <configSections>
    <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
   
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
 
  <Telerik.Reporting>
    <assemblyReferences>
      <add name="Brema.Entities" version="1.0.0.0" culture="neutral" publicKeyToken="null"/>
    </assemblyReferences>
  </Telerik.Reporting>
   
</configuration>
Katia
Telerik team
 answered on 24 Jan 2017
4 answers
41 views
Hello,

How to edit graphic label (values). Of bars
Stef
Telerik team
 answered on 24 Jan 2017
1 answer
100 views

Hello,

I have a window with the Telerik Report that is defined with:

<tkrep:ReportViewer Name="Viewer"
             ViewMode="PrintPreview"
             ZoomMode="FullPage" />

 

When the window is displayed, the application shows an error window with "Object reference not set to an instance of an object."

If I remove the ZoomMode="FullPage" attribute, the NRE is not displayed.

Note also that this was working correctly until I install version R1 2017 of Telerik Reporting.

If that could help you, here is the stack trace at the place the exception is generated:

     Telerik.ReportViewer.Wpf.dll!Telerik.ReportViewer.Wpf.ReportViewer.ApplyZoomMode() Line 698    C#
     Telerik.ReportViewer.Wpf.dll!Telerik.ReportViewer.Wpf.ReportViewer.OnZoomModePropertyChanged(System.Windows.DependencyObject d = {Telerik.ReportViewer.Wpf.ReportViewer}, System.Windows.DependencyPropertyChangedEventArgs e = {System.Windows.DependencyPropertyChangedEventArgs}) Line 654    C#
     WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)    Unknown
     PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)    Unknown
     Telerik.ReportViewer.Wpf.dll!Telerik.ReportViewer.Wpf.ReportViewer.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e = {System.Windows.DependencyPropertyChangedEventArgs}) Line 728    C#
     WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)    Unknown
     WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp = {System.Windows.DependencyProperty}, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)    Unknown
     WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)    Unknown
     PresentationFramework.dll!System.Windows.Baml2006.WpfMemberInvoker.SetValue(object instance, object value)    Unknown
     System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(object inst, System.Xaml.XamlMember property = {System.Windows.Baml2006.WpfXamlMember}, object value)    Unknown
     System.Xaml.dll!MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(object obj = {Telerik.ReportViewer.Wpf.ReportViewer}, System.Xaml.XamlMember property = {System.Windows.Baml2006.WpfXamlMember}, object value = FullPage)    Unknown
     System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(MS.Internal.Xaml.Context.ObjectWriterContext ctx = {MS.Internal.Xaml.Context.ObjectWriterContext}, System.Xaml.XamlMember prop = {System.Windows.Baml2006.WpfXamlMember}, object value = FullPage, bool onParent = true)    Unknown
     System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(MS.Internal.Xaml.Context.ObjectWriterContext ctx = {MS.Internal.Xaml.Context.ObjectWriterContext})    Unknown
     System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndMember()    Unknown
     PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader = {System.Windows.Baml2006.Baml2006Reader}, System.Xaml.XamlObjectWriter xamlWriter = {System.Xaml.XamlObjectWriter}, bool onlyLoadOneNode = false, bool skipJournaledProperties = false, bool shouldPassLineNumberInfo = true, System.Xaml.IXamlLineInfo xamlLineInfo = {System.Windows.Baml2006.Baml2006Reader}, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack = {MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame>}, System.Windows.Markup.IStyleConnector styleConnector = null)    Unknown
     PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)    Unknown
     PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader = {System.Windows.Baml2006.Baml2006Reader}, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri)    Unknown
     PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream = {MS.Internal.AppModel.BamlStream}, System.Windows.Markup.ParserContext parserContext = {System.Windows.Markup.ParserContext}, object parent, bool closeStream = true)    Unknown
     VIS.exe!PrintPreviewWnd.InitializeComponent() Line 1    Elements

Stef
Telerik team
 answered on 23 Jan 2017
1 answer
285 views
 I trying to remove the xaxis label.Actually the report has one  category group and one child category group .but i need to show category group point as a label ..how i fix this ???
Katia
Telerik team
 answered on 23 Jan 2017
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?