HTML View content not always updating

  • 3p
    azoccolillo3p 2 weeks, 5 days ago

    We have a report that uses a FormattedText box inside of a table. When we have 2 windows open…one with the edit for for a record, the other is the HTML report viewer…. data in the report is not showing the changes saved while editing. Even if we close the web page and reopen, the updated data in a FormattedText box is not updating (as though it were cached). I’m certain the data changes are being saved, as I can see them in SQL server. Also, if I export the report to PDF the changes are there…only within the viewer are they not changing. I’ve tried deleting browser cache, reloading the report, changing parameters, etc…nothing works.

    Any ideas? Is there a way to flush a cache from code?

    Thanks,

  • 188p
    AbdiasM188p 2 weeks, 4 days ago

    Have you tried disposing the report object after updating the value in the database and re-loading the report in the WebViewer like below:

    SqlConnection conn = new SqlConnection(connString);
     SqlCommand cmd = new SqlCommand(“Update HtmlContent set HtmlText=’<body>Modified Value</body>‘”, conn);
     conn.Open();
     cmd.ExecuteNonQuery();
     conn.Close();
     rpt.Dispose();
    
     rpt = new PageReport();
     rpt.Load(new FileInfo(Server.MapPath(“~/Reports/RdlReport1.rdlx”)));
     WebViewer1.Report = rpt;

    When I tried this, it displayed the modified value from the database.

  • 3p
    azoccolillo3p 2 weeks, 4 days ago

    I don’t really follow this…

    I don’t load my report from the controller. I’m using the MVC HTML Viewer. The report gets loaded from javascript.
    // Set up buttons to change reports
    var reportsButtons = $(‘#btnReport button’);
    reportsButtons.bind(‘click’, function (ev) {
    ev.stopImmediatePropagation();
    reportsButtons.removeClass(‘active’);
    var target = $(ev.target);
    target.addClass(‘active’);
    var reportOption = {
    id: target.attr(‘data-bind’)
    };
    reportsButtons.prop(‘disabled’, true);
    viewer.option(‘report’, reportOption);
    });

    $(‘#btnReport button’).first().addClass(‘active’);
    viewer.option(‘uiType’, ‘desktop’);
    setTimeout(function(){
    loadreport();
    }, 800);
    });

  • 42p
    DeepakSharma1442p 2 weeks, 1 day ago

    Hello,

    Calling the ‘Refresh()’ on HTML 5 Viewer control should reload the Report with updated changes in this case.
    Please have a look at the attached sample application, make any changes to ‘customers.json’ file and see that the updated values can be seen on the report “Test.rdlx’ after clicking on “refresh’ button.

    Regards,
    Deepak Sharma

    Attachments:
    1. HTML5-Viewer.zip
  • 3p
    azoccolillo3p 1 week, 5 days ago

    I’ve added a refresh button to the viewer but it will take some time to see if this takes care of the problem.
    Thanks

  • 42p
    DeepakSharma1442p 1 week, 4 days ago

    Hi,
    It works fine at my end for reloading the report with updated database values. In case the issue still remains unresolved , please feel free to get back to me.

    Regards,
    Deepak Sharma

  • 3p
    azoccolillo3p 5 days, 2 hours ago

    Ok, after some experimentation the refresh button running viewer.refresh() does not refresh the data. I need to reload the page to get the data to refresh. When I reload the page, the data is already refreshed correctly. Is this an issue with the browser caching content?

  • 42p
    DeepakSharma1442p 4 days, 10 hours ago

    Hi,

    I tested this issue with both the JSON and OLEDB database. It is working absolutely fine here at my end.
    After loading the report in Viewer I made few changes in the database table and JSON file and found the changes updated in report on refreshing the Viewer using the code I provided in my earlier post.

    You may try reloading the browser window by calling :

    function funRfresh()
    {
    viewer.refresh();
    window.location = window.location;
    }

    In case the issue still persists, please provide me a small sample application to debug it further.

    Regards,
    Deepak Sharma

  • 3p
    azoccolillo3p 4 days, 3 hours ago

    Oh, I didn’t have the window.location = window.location; line in my code. That fixed it. Works great now, thanks.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.