Telerik Forums
Reporting Forum
1 answer
108 views
How to generate telerik report using web service? As I have converted web service as list. Now I dont know how to bind in telerik report?
Stef
Telerik team
 answered on 14 May 2015
7 answers
2.0K+ views
Hi there

We have a simple report that works fine when tested in the development environment but when we publish it we get a red error box on every databound field saying....

'The expression contains object <field_name> that is not defined in the current context'

What is strange is we have dozens of other reports in the same library that all work fine.

Can anybody point me at what we are doing wrong as I am struggling to understand why this report fails when it is published.

We are using Q1 20111.

Any help greatly appreciated.


Stef
Telerik team
 answered on 14 May 2015
6 answers
892 views
I have a report that I've created that is consumed by a Windows Form application that displays the report, and then exports the report to PDF and Microsoft Word.  

In one section of the report, I am using the PictureBox control to load the thumbnail image, and this works fine.  I also want the users to be able to drill down or click on the image and have it launch the actual image. 

My directory structure looks like this

C:\Reports                                               ---Main Report Directory
C:\Reports\0001                                      ---Client Directory
C:\Reports\0001\0002                             ---Project Directory
C:\Reports\0001\0002\Report                 ---Actual directory where the PDF / Word document versions of the reports are exported too.
C:\Reports\0001\0002\Report\Thumbs   ---Directory where the thumbnail sized images are stored.
C:\Reports\0001\0002\Report\Images    ---Directory where the full sized images are stored.

So, my code exports the PDF / Word documents to the directory named C:\Reports\0001\0002\Report

If I code my Action up like this, using a physical path, everything works fine:

            Dim strDrillDownURL As String = "file:///C:/Reports/0001/0002/Report/Images/12345.jpg"

            Dim UrlAction1 As New Telerik.Reporting.NavigateToUrlAction()
            UrlAction1.Target = UrlTarget.NewWindow
            UrlAction1.Url = strDrillDownURL

            Me.imgThumbNail.Value = "C:\Reports\0001\0002\Report/Thumbs\12345.jpg"
            Me.imgThumbNail.Action = UrlAction1

When the user opens the PDF or the Word Document and clicks on the thumbnail image associated with the picture, a new window pops open with the full sized image.

However, in my situation, I will need to copy this report directory to a thumb drive and send it to my client.  With this in mind, I want to be able to change the drill down action to use a relative path so that if this thumbnail drive becomes their E: drive, they will still be able to click through to the full sized images.

With this in mind, I've tried many variations of the file:/// relative path implementation, but have yet to find one that works.  My current rendition looks something like this:

            Dim strDrillDownURL As String = "file:///./Images/12345.jpg"

            Dim UrlAction1 As New Telerik.Reporting.NavigateToUrlAction()
            UrlAction1.Target = UrlTarget.NewWindow
            UrlAction1.Url = strDrillDownURL

            Me.imgThumbNail.Value = "C:\Reports\0001\0002\Report/Thumbs\12345.jpg"
            Me.imgThumbNail.Action = UrlAction1

I've spent many hours on Google to try to determine what the proper syntax to use for my drill down URL.  I've come close, in many cases, but I must I am at a loss here.

Does anyone have any suggestions?

Thanks.
Nasko
Telerik team
 answered on 14 May 2015
5 answers
356 views

Hello

Today I started designing my first report in the standalone report designer for the HTML 5 report viewer. Up to now, all reports were type definitions in a class library.

We have some elements that need to be adjusted through bindings in respect of size or position according to the user's settings in the data base. This is done through global functions defined in the same reports class library. So I added the reports library as assembly reference for binding in XML reports for being able to use the same function bindings in the XML report as used in the report type definitions.
So long so good. After having added this reference, binding works. For example assigning a value through such a bound function works as expected. Also the binding of functions for size and position doesn't throw an error. It just does nothing! the picture box stays where it's positioned in the report and keeps the size defined in the report. It drives me crazy!

Function binding looks as follows:
<Binding Path="Size" Expression="=ReportingLib.GlobalFunctions.setPictureSize(ReportingLib.GlobalFunctions.tryPath(Fields.Organisation_ID,&quot;ListHeaderPortrait&quot;))" />
                <Binding Path="Location" Expression="=ReportingLib.GlobalFunctions.setLocation(Fields.Organisation_ListHeaderX, Fields.Organisation_ListHeaderY)" />
                <Binding Path="Value" Expression="=ReportingLib.GlobalFunctions.tryPath(Fields.Organisation_ID,&quot;ListHeaderPortrait&quot;)" />

As mentioned above, the Value binding works as expected but both Size and Location binding does nothing. The functions return Telerik drawing units:
        Return New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(width, Telerik.Reporting.Drawing.UnitType.Pixel), New Telerik.Reporting.Drawing.Unit(height, Telerik.Reporting.Drawing.UnitType.Pixel))
        Return New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(x, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(y, Telerik.Reporting.Drawing.UnitType.Cm))

Thanks for any help!


Nasko
Telerik team
 answered on 14 May 2015
8 answers
321 views
Hello, I'd like to know what property should I used to set the color for every series in a Pie report. Thanks
Nasko
Telerik team
 answered on 13 May 2015
3 answers
132 views

Hi

i have an kendo ui grid and i need to pass selected rows in my grid to report to let me print them from report 

i try to find any thing like that in demo but i faild

so please hope to give me sample code or sample example to let know how can i do that

 thanks a lot ....

 

        @(Html.Kendo()
              .Grid<kind>()
              .Name("kinds_")
              .Columns(columns =>
              {
                  columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' #= kind_id ? checked='':'checked' # class='chkbx' />");
                  columns.Bound(e => e.kind_name).Width(300).Title("اسم المجموعه الرئيسيه");
 
                  columns.Command(command =>
                  {
                      command.Edit()
                             .Text("تعديل")
                             .UpdateText("حفظ")
                             .CancelText("الغاء");
                      command.Destroy().Text("حذف");
                  });
              })
              .Filterable(filterable => filterable.Operators(operators => operators.ForString(str => str.Clear().StartsWith("يبدء بـ").IsEqualTo("يساوى").IsNotEqualTo("لا يساوى").Contains("يحتوي علي").DoesNotContain("لا يحتوي علي"))).Operators(operators => operators
                                                                                                                                                                                                                                                                          .ForNumber(str => str.Clear().IsEqualTo("يساوى").IsNotEqualTo("لا يساوى").IsGreaterThanOrEqualTo("أكبر من أو يساوى").IsGreaterThan("أكبر من").IsLessThanOrEqualTo("أقل من أو يساوى").IsLessThan("أقل من"))).Messages(m => m.And("و")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     .Or("أو")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     .Filter("بحث")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     .Clear("إلغاء")
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     .Info("حدد فلتر البحث الذى تريده")))
              .ToolBar(tools => tools.Create().Text("اضافه مجموعه رئيسيه جديده"))
 
        @* السطر ده عشان تخلى التعديل عن طريق PopUp *@
              .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.PopUp).TemplateName("AddEditkind"))
         
              .Pageable()
              .Sortable()
              .Filterable()
              .DataSource(source => source.Ajax()
                                          .Model(model =>
                                          {
                                              model.Id(e => e.kind_id);
                                          })
                     
                                          .Events(events => events.Error("error_handler"))
                                          .Read(read => read.Action("Read_kind", "kinds"))
                                          .Update(update => update.Action("Update_kind", "kinds"))
                                          .Create(create => create.Action("Create_kind", "kinds"))
                                          .Destroy(destroy => destroy.Action("Destroy_kind", "kinds")))
         
              .ClientDetailTemplateId("CategoriesTemplate")
        )
 
@section scripts
{
    <script type="text/javascript">
 
        $(function () {
            $('#kinds_').on('click', '.chkbx', function () {
                var checked = $(this).is(':checked');
                var grid = $('#kinds_').data().kendoGrid;
                var dataItem = grid.dataItem($(this).closest('tr'));
                dataItem.set('kind_id', checked);
            })
        })
 
        function error_handler(e) {
            productsTemplate
            if (e.errors) {
                var message = "Errors:\n";
                $.each(e.errors, function (key, value) {
                    if ('errors' in value) {
                        $.each(value.errors, function () {
                            message += this + "\n";
                        });
                    }
                });
                alert(message);
            }
        }
    </script>
}
 

 

Stef
Telerik team
 answered on 13 May 2015
1 answer
382 views

I am using MVC Demo for Telerik Reporting. I have few questions which I really want to know before start working with Telerik Reporting.

 1.) I am binding Report Data source dynamically from code behind(on Report's Code page). Initially Report is Loading fine. What I want, when user enter value into report parameter and click on preview button.... Is that possible to handle those parameters and update object data source and update reporting from code side? Actually I don't want get whole data at time.Right now I don't find any event that give me report parameters value on Preview Button click.

 

 2.) Initially if I don't come on Report Page with whole data, Is that possible to update data-source programaticaly later. Like on Preview Button click, or any other button click out side Report  Viewer. Because I want to add one functionality  where I would have one button on Page and on click of that button I would read report Parameters and save into DB. But right now I am not able to read Report Parameters server side once Report Loaded.

 

3.) I have added One Report parameter and trying to just display it on Designer nothing else but It is just render with initial value.Later if I change parameter to any value it doesn't reflect. Is there any problem in setting report viewer. I have checked Telerik Example and Report Parameter value get update there. So that I am sure I m missing some thing but not able to found it. 

 

 

 

 

Nasko
Telerik team
 answered on 13 May 2015
17 answers
1.0K+ views
Hi,

I would like to purchase telerik controls for my company but I will buy this product if you can provide me solution of below these problems because we are happy to buy this product.

Problem 1:  I am using report Viewer for printing but every time when I click a button it shows a print dialog box which is very annoying sometimes. Is there anyway that I can set a default printer for that print button one time only.

Problem 2:  I want to tell you that I have tried this method for directly send the job to the printer but it works fine in my development machine and the job goes directly to the printer but when I deployed the same code in the server the page never comes back.

        Dim printerSettings As New System.Drawing.Printing.PrinterSettings

        Dim standardPrintController As New System.Drawing.Printing.StandardPrintController        
        Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor
        reportProcessor.PrintController = standardPrintController
        reportProcessor.PrintReport(o, PrinterSettings)






Stef
Telerik team
 answered on 12 May 2015
4 answers
385 views

Hi 

 

I am currently using the Reporting tool 2011 Q3

 

I know it is an outdated version of the tool.

 Just would like to know if anyone could assist me.

 I have the standard options that comes with the report viewer to export the data.

 When the users export the data in excel or pdf the file seems to export as i have created the report.

The issue i am having is when i export the data in a csv format 
i have two sub reports in my main report and a page break which separates the two sub reports.

The first sub reports data gets exported but the second one doesn't any idea how i could resolve this or remove the option of exporting to Csv.

 

i have tried 

<Telerik.Reporting>
    <Extensions>
      <Render>
        <Extension name="CSV" visible="false">
        </Extension>
      </Render>
    </Extensions>
  </Telerik.Reporting>

 

but it does not work.

 

Regards

 

Ismail
Top achievements
Rank 1
 answered on 12 May 2015
2 answers
132 views

Hello, i would like to get action (in mine case it is NavigateToReport) object on textbox databound event.

 As i see in VS watch there is parameter which gives action object. But its visible only in runtime.

 public void textboxdatabound(object sender, EventArgs e)
{
    var tbox = (Telerik.Reporting.Processing.TextBox)sender;
    var action = ((Telerik.Reporting.Processing.ReportItemBase)(tbox)).Action;  <--- Gives unknown member error.
}

Stef
Telerik team
 answered on 12 May 2015
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?