PDF loader popup using SharePoint Visual Web Part with progress bar wait till report is loaded
I was facing a problem to load pdf generated document in a popup window. The problem was user saves some information from a custom front end to SharePoint List and on the list event handler there was a code written to generate a SQL report and export it into pdf document all through code and save the pdf document to another SharePoint library.
Now the actual problem is when user saves the information, immediately user wanted to see the pdf document generated in a popup window. Now if I code everything (document generation code) on click of Save button then it takes a lot of time and frustrate user for waiting for a long to save the data. So to follow a disconnected approach, on click of save we are just saving the data in SharePoint list and on the list there is an asynchronous event handler which generates the document when any item is added in the list.
Now you might have understood the background, here is what I am going to present the code which actually loads the pdf document in a popup window. I call it PDFLoader. It is a visual web part in SharePoint.
Visual Web Part: HTML Part
<b> Please wait while system is generating the document...... </b>
// code to load the pdf document if it is generated from the Event hander
// code will first check in the SharePoint library if isDocumentLoaded flag is True, and accordingly return, if it is true then load the data and return, if not then just return the flag, according to this flag the auto refresh meta property is set in the header of the page