Httpclient.Timeout after 100 second

Stimulsoft Reports.WEB discussion
Post Reply
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Hello,

We are getting Httpclient.Timeout error after 100 second while loading large dataset. How to increase that httpclient timeout? Below are the details what we are using.

Version - 2025.4.3
Stimulsoft.Data.GraphQL - 2025.4.3 --> Seems like problem is somewhere here as we uses graphql query and that get's timeout.
Tech - .Net core, Angular

We are trying to export the report which uses datasource of graphql and it does works well with 10K records but when I change it to 100K, it throws the timeout error in our custom export feature "report.Render(false)". Tried to extend timeout of viewer but it didn't works.

Thanks.
Vadim
Posts: 431
Joined: Tue Apr 23, 2013 11:23 am

Re: Httpclient.Timeout after 100 second

Post by Vadim »

Hello

For web requests please use

Code: Select all

StiAngularViewerOptions options.Server.RequestTimeout
(seconds)
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Re: Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Hello Vadim,

Sorry for being late on the response but unfortunately it didn't works after updating RequestTimout as it still get expired after 100 seconds.

What we wanted to achieve here is:
1. Our report uses graphQL as an datasource, data may get's vary depending on the query hence we want the report to wait till they receive data to fill show report but it does not wait and throws timeout error.
2. To avoid this, what we did was try to export the pdf, excel, html of that report instead of viewer to make it easy for processing but we did notice issues in that too. Like if you below code where we are trying to setup data sources for report so that we can handle timeout if api requires more time to return the result set and it does works too but when we did set that result in the report data it still hit the data source to get it when we did

Code: Select all

report.Render(false);
Not sure what we are missing here.

Getting Report Object ready:

Code: Select all

var report = new StiReport();
var data = _context.GetReportById(id);
report.LoadPackedReportFromString(data.PacakedDataString);
Fetching manual data and setting up datasource of report:

Code: Select all

var gql = report.Dictionary.DataSources.OfType<StiGraphQLSource>().First();
if (gql != null)
{
    var gqlQuery = ((Stimulsoft.Report.Dictionary.StiGraphQLDatabase)gql.Dictionary.Databases.Items[0]).Query;
    var gqlUrl = ((Stimulsoft.Report.Dictionary.StiGraphQLDatabase)gql.Dictionary.Databases.Items[0]).EndPoint;

    // Execute GraphQL manually
    var result = await ExecuteGraphQL(
        endpoint: gqlUrl,
        query: gqlQuery,
        variables: null,
        timeoutSeconds: 1200
    );

    
    //report.Dictionary.DataSources.Remove(gql);
    //var gqlDb = report.Dictionary.Databases.OfType<StiGraphQLDatabase>().FirstOrDefault();
    //if (gqlDb != null)
    //    report.Dictionary.Databases.Remove(gqlDb);

    var items = (JArray)result[gql.Name]["items"]; // depends on your API
    var table = ToDataTable(items);
    //report.RegBusinessObject("Connection", result);
    //report.RegBusinessObject($"{gql.Name}_Items", items);
    report.RegData($"{gql.Name}_Items", table);
    //report.Dictionary.Synchronize();
}
Export pdf code:

Code: Select all

var service = new StiPdfExportService();
service.ExportPdf(report, stream, settings);
Notes:
- In report.RegData("NAME",table); NAME is the same data source name in designer that we have.
- I did tried to remove Datasource from dictionary and it returns blank report
- Did tried Dictionary synchronize too but still it didn't works.

The issue we are facing is even if we are setting up datasouce to report it still try to fetch the data again when we do

Code: Select all

report.Render(false);
. How can we stop that and also is it the right way of setting up datasource? (Ref.) Attached picture of report designer to just let you know what we did so far.

Thanks. Sorry for long message but trying to explain all key things so that you can help us.Image
Attachments
Report_Designer_Sample.png
Report_Designer_Sample.png (238.52 KiB) Viewed 379 times
Vadim
Posts: 431
Joined: Tue Apr 23, 2013 11:23 am

Re: Httpclient.Timeout after 100 second

Post by Vadim »

Hello

Maybe you should extend Query Timeout for database?
2.png
2.png (19.35 KiB) Viewed 339 times
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Re: Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Hello,

We are not using MySQL as we do uses GraphQL (we manage connection timeout of DB request and stuff). We need to understand how do I stop report data fetching mechanism and use my data that I assign to it as it is currently calling report data while we are doing report.Render().

Thanks.
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Re: Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Kind Reminder
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Re: Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Hello Vadim,

Is there any updates on this?

Thanks.
Vadim
Posts: 431
Joined: Tue Apr 23, 2013 11:23 am

Re: Httpclient.Timeout after 100 second

Post by Vadim »

Hello

You can't stop data fetching during report generation.
Can you send us full error stack trace?
ShakeebAhmed
Posts: 22
Joined: Wed Nov 12, 2014 2:22 pm

Re: Httpclient.Timeout after 100 second

Post by ShakeebAhmed »

Hello,

We are getting "Timeout error after 100 sec" if report data fetching exceeded the time limit. As we are using "report.Render(false)" method to render report and then export it, 99% times our dataset is in large scale and would take approx. 5-10 min to load them. Hence we tried to load them by ourself so that we can assign it to report dictionary to use it instead of re-loading again during rendering. Is there any way to extend time in graphql request if we can't stop report to fetching data calls?

Thanks.
Lech Kulikowski
Posts: 7568
Joined: Tue Mar 20, 2018 5:34 am

Re: Httpclient.Timeout after 100 second

Post by Lech Kulikowski »

Hello,

There are no timeout settings for GraphQL in the designer. Try to check the IIS timeout settings.

Thank you.
Post Reply