Telerik Forums
Reporting Forum
1 answer
243 views
Hello together

I have two nearly identical reports and in both the same problem:
I've got three subreport items side by side but even when I put them next to each other there are horizontal spaces between the three subreports.
The subreport items' sizes match the actual report sizes and I already tried making the subreport items a bit wider than the actual reports.
I even had the problem that the right margin of the 3rd subreport item didn't fit right below the line above even though in the designer they were aligned properly.
This one I was able to fix (don't know how exactly) but the spaces between the reports I wasn't able to fix.

Thanks for any help
Nasko
Telerik team
 answered on 13 Jan 2015
3 answers
297 views
Hi ,

I have a table created from a table wizard  and now i want to insert a subreport below it  based one of its fields.

CustomerId Customer Report
Sub report related  to  Each customer ID

I have done the passing of the Customer ID field to the Subreport  customer Id  filter....but   an error keeping coming saying

Exception: Invalid value of report parameter 'CustomerID'.]

Can anyone throw some light on it please?

 
Nasko
Telerik team
 answered on 13 Jan 2015
1 answer
260 views
I'm trying to add 2 sub reports programmatically on the report footer section like this

               //This is called twice with a different myString content which is a XML string
                XmlReaderSettings settings = new XmlReaderSettings();
                settings.IgnoreWhitespace = true;

                using (XmlReader xmlReader = XmlReader.Create(new StringReader(myString), settings))
                {
                    ReportXmlSerializer xmlSerializer = new ReportXmlSerializer();

                    Telerik.Reporting.Report subreport = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
                    Telerik.Reporting.InstanceReportSource source = new Telerik.Reporting.InstanceReportSource();
                    source.ReportDocument = subreport;

                    Telerik.Reporting.SubReport footerSubReport = new Telerik.Reporting.SubReport();
                    footerSubReport.ReportSource = source;
                    footerSection.Items.Add(footerSubReport);
                }
            }
        }

These 2 sub reports were created originally on the Telerik Designer with extension trdx and then changed to xml. The width of both is 15cm while on the main report, the width is 19.51cm. Enough to avoid and spread of the width.

When only 1 sub report is added everything is ok but then when I add both subreports; blank pages are added. I tried to change the background color to identify the problem. Each sub report is really narrow (15 cm) in contrast to the main report (19.51 cm) but the report footer looks bigger in width producing the blank pages.

I set property KeepTogether of my report footer to false and each sub report xml has the property PageBreak = Before.

These are my two subreports in xml format

---------------------------------
Sub Report 1 
---------------------------------

<?xml version="1.0" encoding="utf-8"?>
<Report Width="15cm" Name="SubReport1" xmlns="http://schemas.telerik.com/reporting/2012/3.5">
  <Items>
    <DetailSection PageBreak="Before" Height="1.7322834332784in" Name="detailSection1">
      <Style Visible="True" BackgroundColor="0, 128, 255" VerticalAlign="Bottom" />
      <Items>
        <TextBox Width="11.7999992370605cm" Height="2.3600001335144cm" Left="0.00010012308478013cm" Top="0.299999848604206cm" Value="Testing1" Name="textBox1">
          <Style>
            <Font Bold="True" />
          </Style>
        </TextBox>
      </Items>
    </DetailSection>
  </Items>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left="2pt" Right="2pt" />
      </Style>
      <Selectors>
        <TypeSelector Type="TextItemBase" />
        <TypeSelector Type="HtmlTextBox" />
      </Selectors>
    </StyleRule>
  </StyleSheet>
  <PageSettings>
    <PageSettings PaperKind="Letter" Landscape="False">
      <Margins>
        <MarginsU Left="0cm" Right="0cm" Top="0cm" Bottom="0cm" />
      </Margins>
    </PageSettings>
  </PageSettings>
</Report>

---------------------------------
Sub Report 2 
---------------------------------

<?xml version="1.0" encoding="utf-8"?>
<Report Width="15cm" Name="SubReport2" xmlns="http://schemas.telerik.com/reporting/2012/3.5">
  <Items>
    <DetailSection PageBreak="Before" Height="1.7322834332784in" Name="detailSection1">
      <Style Visible="True" BackgroundColor="0, 128, 255" VerticalAlign="Bottom" />
      <Items>
        <TextBox Width="11.7999992370605cm" Height="2.3600001335144cm" Left="0.00010012308478013cm" Top="0.299999848604206cm" Value="Testing2" Name="textBox1">
          <Style>
            <Font Bold="True" />
          </Style>
        </TextBox>
      </Items>
    </DetailSection>
  </Items>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left="2pt" Right="2pt" />
      </Style>
      <Selectors>
        <TypeSelector Type="TextItemBase" />
        <TypeSelector Type="HtmlTextBox" />
      </Selectors>
    </StyleRule>
  </StyleSheet>
  <PageSettings>
    <PageSettings PaperKind="Letter" Landscape="False">
      <Margins>
        <MarginsU Left="0cm" Right="0cm" Top="0cm" Bottom="0cm" />
      </Margins>
    </PageSettings>
  </PageSettings>
</Report>

Luis
Top achievements
Rank 1
 answered on 12 Jan 2015
3 answers
463 views
I am trying to change the connection string of a UriReportSource at runtime in an MVC 4 application.  I am using this page as a guide:

http://www.telerik.com/support/kb/reporting/details/changing-the-connection-string-dynamically-according-to-runtime-data

However I end up getting this error: "Unable to get report parameters: Missing report name"

Here is the ReportsController:

public class ReportsController : ReportsControllerBase
{
    protected override IReportResolver CreateReportResolver()
    {
 
        var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");
 
        return new ReportFileResolver(reportsPath)
            .AddFallbackResolver(new ReportTypeResolver());
        //return new CustomReportResolver();
    }
 
    protected override ICache CreateCache()
    {
        return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
    }
}

Code for the controller for the view containing the ReportViewer:

public ActionResult Index()
{
    string connectionString = GetConnectionString();
    ReportConnectionStringManager connStringManager = new ReportConnectionStringManager(connectionString);
    string uri = Server.MapPath("/Reports/Tickets2.trdx");
    UriReportSource theReport = new UriReportSource() { Uri = uri };
    InstanceReportSource fixedReport = connStringManager.UpdateReportSource(theReport);
    return View(new ReportModel() { TheReport = fixedReport });
}
 (Note that ReportModel.TheReport is of type InstanceReport)

And the View:

@model FastTrack.MVC.Models.ReportModel
@{
    ViewBag.Title = "Reports";
}
 
@section styles
{      
    <link href="ReportViewer/styles/telerikReportViewer-8.1.14.618.css" rel="stylesheet" />
<style>
        #reportViewer1 {
            position: relative;
            width: 100%;
            height: 1000px;
            font-family: 'segoe ui', 'ms sans serif';
            overflow: hidden;
        }
    </style>
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
}
 
@section scripts
{
    <script src="ReportViewer/js/telerikReportViewer-8.1.14.618.js"></script>
}
<div class="container">
<div class="row">
            @(Html.TelerikReporting().ReportViewer()
                   .Id("reportViewer1")
                   .ServiceUrl("/api/reports/")
                   .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.618.html")
                   .ReportSource(@Model.TheReport)
                   .ViewMode(ViewModes.INTERACTIVE)
                   .ScaleMode(ScaleModes.SPECIFIC)
                   .Scale(1.0)
                   .PersistSession(false)
                   )
 
    </div>
    </div>

I have verified that passing the reportviewer is working when simply passing the report in as a Uri, but we have to be able to change the connection string dynamically because or data/connections are tenant-based.

Any help is appreciated
Stef
Telerik team
 answered on 12 Jan 2015
12 answers
2.0K+ views
I have a report where I need to dynamically show a different image on a row-by-row basis based on the data in that row. Is there an example on how to do this? If not, if someone has figured this out can you post an example?
KS
Top achievements
Rank 1
 answered on 12 Jan 2015
1 answer
153 views
Hi Sir,
      Here, we are using Report Book for multiple reports for a particular patient. Where the reports, occupies every single page for each report.
so, here i am tried with Sub Report., but i cant able to get the solution as well. I need to merge multiple reports. 

please see the attachment (screenshot : Print.jpg)

Thanks & Regards,
 R. Sindhu.

Stef
Telerik team
 answered on 09 Jan 2015
20 answers
3.2K+ views
Hi again, I need to pass a parameter to reportViewer, in the report that I designed in telerik report designer I added a parameter so I want to pass the values ​​from a String value outside the ReportViewer I do not want to enter the value in the field shown in the reportviewer beside the preview button. (see report.png image) and i need s

Is there any way to access these properties? and how to resize the text box that receives the parameter because I want my reportviewer size you see in the picture but the box paraecer shrinks when I change the size of reportviewer, and I need to call the click event Preview button but from another button, is that possible? being so hide the parameter, and how I do to remove this error "An error has occurred while processing, incorrect syntax near ')' " this happens because I don't give a value I just set the "=Parameters.Name.Value"

Sorry for my English, I hope you can help me!
Fridli Jacober
Top achievements
Rank 1
 answered on 09 Jan 2015
1 answer
179 views
I've reported this in a support ticket, but a) I haven't had a response yet, and b) I thought others ought to be aware of this too.
I've managed to get reports with the html5 report viewer working fine a few months ago, but somehow the instructions on the Telerik site don't seem to have kept up with changes to the standard Visual Studio MVC/WebApi templates.
From my support ticket request:

I've been trying to get even a basic Report working in MVC/WebApi projects and the Telerik current instructions as to how to do it no longer seem to work, perhaps because of changes in the versions of some Microsoft dlls (and possible changes in the template files, eg to WebApiConfig.cs and Global.asax) in current Visual Studio 2013 Update 3 projects.

I've had a variety of problems, including run time errors (like the one below, or saying that the .../client resource could not be found), but I attach an example project.

This project was just a basic, right out of the box MVC5/WebApi web application that I created from the templates in Visual Studio 2013 Update 3.  I checked that it built and ran fine. I then added a Telerik Html5 Report Viewer Item Template (Q3 2014) to the project.  A report page then came up telling me that I needed to add various redirects to the web.config file (because the project contained newer versions of dlls than those expected) - I added these lines to the web.config file.

Then I built the project successfully, but when I tried running it, I got the following error in Application_Start() in Global.asax.cs: " Adding or removing items from a 'HttpRouteCollection' is not supported. Please use a key when adding and removing items":


 // this line gives the following error when running the project:
            // Adding or removing items from a 'HttpRouteCollection' is not supported. Please use a key when adding and removing items.
            ReportsControllerConfiguration.RegisterRoutes(GlobalConfiguration.Configuration);

How can I solve this?  Please will you consider rechecking your installation instructions and modifying them as necessary so that they work with the current Visual Studio standard templates for MVC/WebApi projects?
Stef
Telerik team
 answered on 08 Jan 2015
12 answers
224 views
I don't understand why, but when I add a Table Wizard, I can't select or Add any Data source. Can you tell me why ?  thanks.
Stef
Telerik team
 answered on 08 Jan 2015
1 answer
307 views
I'm using the HTML5 report viewer with an ObjectDataSource.  The model referenced by the ObjectDataSource is populated by a logic call from a service that is injected in my MVC reports controller.  Unless the model exposes a static method to get the data for the report, no data is returned in the report (all fields are empty).  However, when the method is static, two different clients accessing two different sets of data (different filter parameters in the controller), are stepping on each other, and the wrong report is rendered for the second user.  For example, if I log in to my application from two different browsers (Chrome and FF, for example), load the report with different data filter parameters in each browser (which should display two different reports), and then refresh both browsers simultaneously, both render the same report because of the static method.  Obviously, this is a big problem for a multi-user web application - it is assumed that a report should be accessible by many users that are viewing different data.

How can an ObjectDataSource be used with non-static methods?  Or, assuming you have a business logic layer call that returns a collection of objects to feed a Telerik report, how should an HTML5 Telerik report be architected for multi-user access, where the same report can be rendered simultaneously for multiple users accessing different data (invoices for example)?

Thanks!
Stef
Telerik team
 answered on 08 Jan 2015
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?