Show report by passing dynamic parameter

2 Answers 296 Views
DataSource SQL Report Parameters Report Viewer - Blazor
Jayesh
Top achievements
Rank 1
Jayesh asked on 11 Jul 2023, 04:41 AM | edited on 11 Jul 2023, 05:05 AM
Hi All,

I am trying to Show Detail of a multiple Orders by, passing their order number . I have to manually select the  order number to display their details(which is coming from by passing ordernumber in store procedure).

I want to pass parameter dynamically in report parameter.

Please suggest!


Thanks in advance
Jayesh

2 Answers, 1 is accepted

Sort by
1
Dimitar
Telerik team
answered on 13 Jul 2023, 01:48 PM

Hello Jayesh and Tursunkhuja,

Based on the description, I think that the Invoice Report Demo | Telerik Reporting fits your requirements(although, this example shows only 1 selected order). The report from this demo is also shipped with the installation of the product and can be found at the following path:

C:\Program Files (x86)\Progress\Telerik Reporting <Release>\Report Designer\Examples

You may use this report as a reference when creating your or you may try the help of the Invoice Report Wizard at a Glance - Telerik Reporting.

Once the report is created, you may pass a value to the report from the Blazor application through the Blazor Report Viewer's ReportSource property, for example:

<button onclick="@RefreshViewer">Refresh with new parameter value</button>

<ReportViewer ServiceUrl="/api/reports"
    @ref=rv1
    @bind-ReportSource="@ReportSource"
    @bind-ScaleMode="@ScaleMode"
    @bind-ViewMode="@ViewMode"
    @bind-ParametersAreaVisible="@ParametersAreaVisible"
    @bind-DocumentMapVisible="@DocumentMapVisible"
    @bind-Scale="@Scale"
    PageMode="@PageMode.ContinuousScroll"
    EnableSendEmail="true"
    ServiceType="@ReportViewerServiceType.REST"
    Height="800px"
    Width="100%">
</ReportViewer>
@code {
    ...
    public ReportSourceOptions ReportSource { get; set; } = new ReportSourceOptions(
        "Report1.trdp", 
        new Dictionary<string, object>
    {});

    void RefreshViewer()
    {
        ReportSource = new ReportSourceOptions() {  Report = ReportSource.Report, Parameters = new Dictionary<string, object>() { { "parameter", "value" } } };
    }

Hope this helps, please let me know if you have further questions.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
0
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 12 Jul 2023, 12:26 PM

Hi Jayesh,

Do you have sample report?

 

Thanks,

Tags
DataSource SQL Report Parameters Report Viewer - Blazor
Asked by
Jayesh
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or