Show Data Loading status while data loading instead of showing "No records found" with PrimeNg - primeng-datatable

I am showing tabular data from an angular 2 application with the help of PrimeNg.
When I click on the link to show the table, it shows "No records found" even though data is still loading on the table and eventually the data do show up in the table once data loading is complete.
I want to avoid showing "No records found" , instead would like to show "Data loading....." on the page while data is loading and then show the PrimeNg DataTable once the whole data loading is complete.
Some hints to achieve this goal is eagerly expected.

Have a look to emptyMessage property to customize this label :
<p-dataTable [value]="cars" [responsive]="true">
<p-column field="vin" header="Vin"></p-column>
<p-column field="year" header="Year"></p-column>
<ng-template pTemplate="emptymessage">
Data loading...
</ng-template>
</p-dataTable>

Related

Searching a website and returning found results

With Excel Power query its possible to pull data from a website provided its in a database/table format.
Many online databased are so large however that they implement a search function instead of showing the entire database which is fine but causes a barrier when trying to efficiently locate information for many keywords.
The database I wish to search is:
https://apps.who.int/food-additives-contaminants-jecfa-database/search.aspx
Is it possible to create a list of keywords/CAS numbers and search the database for each of these sequentially and return data found? This is similar to web scraping but with the added step of actually searching for the data beforehand.
It's totally possible to acheive what you want.
First you analyze the page, specifically the input box and the submit button and find what's identify them. I use Chrome Development Tools for this. Just open the desired page and press F12.
In this case the input box is:
<input name="ctl00$ContentPlaceHolder1$txtSearch" type="text" id="ContentPlaceHolder1_txtSearch">
and the submit button is:
<input type="submit" name="ctl00$ContentPlaceHolder1$btnSearch" value="Search" id="ContentPlaceHolder1_btnSearch">
You can then use the ids to address the box with javascript:
var inputBox = document.getElementById('ContentPlaceHolder1_txtSearch');
inputBox.value = 'your search string';
And the equivalent for the submit button:
var searchButton = document.getElementById('ContentPlaceHolder1_btnSearch');
searchButton.click(); // Start the search
When the results are delivered you then need to analyze that page to figure out what javascript code is needed to extract the part of that page that you're interrested in. Or you can dump the complete page with:
document.documentElement.outerHTML;
Excel VBA example code for running javascript on a webpage here:
https://github.com/peakpeak-github/libEdge
Modify the code to suit your needs.

How to extract open graph meta data from a webpage using UIPath RPA?

Learning RPA with UIPath. Happily extracting onscreen data from a website, processing it, using it, etc.
However, there's information in the page that isn't visible, but is in the source, eg, open graph meta tags:
<meta property="og:image" content="https://example.com/foo.jpg" />
What options are open to me to extract this with UIPath? I gather there's an ExtractMetaData flag from ExtractData but I've yet to find a useful tutorial that I can follow at this stage :/
You can try and use Data Scraping option by selecting the respected option from the Wizards Tab as show below:
Now you need to indicate on the screen the area of data that you need to scrape, like:
Structure data in form of table
Specific element on the web page
Or the whole window
Data scraping activity generates a container (Attach Browser or Attach Window) with a selector for the top-level window and an Extract Structured Data activity with a partial selector as per images below:
So all you need to do is place your XML tag as Input under ExtractMetadata field as per image below:
Hope these information will be useful.

Ng-repeat freeze with pagination

I am using ng-repeat to create html table ,in some case I have huge data like 11k rows ,but I am ok with using pagination . SO I am displaying only 25rows per page. But in my case broswer still freezes when I get the response from backend. I am using something like this
<tbody ng:repeat="airport in (filteredList = (orderList(list)) | startFrom: ((currentPage-1)*pageSize) | limitTo:pageSize)">
This is a plunker linkhere. Here it seems to be working fine ,my problem is it freezes when it started rendering table rows, even though it only has to render 25 rows (ie per page records) even all my watchers are set for current page records only . Am I missing something here. Inter page navigation is fine though.

Add print button to cognos report

I am trying to add a print button to a Cognos report to print the whole report which when run is delievered as HTML pages. I used an HTML item and used the code:
<button type="button"onClick="window.print();return false;">Print Report</button>
This only prints the first page even after I select to print all pages. How do I make it to print all the pages?
That is the expected behavior of the code you've written. It's printing the HTML page. Cognos doesnt return all the results - it pages to 20 rows by default. The extra rows are not hidden on the page. Don't try to reinvent the wheel here. HTML was not designed for printing. Export to PDF and print from there.

Can I add a button to a CFGRID that lets a user export the grid to an XLSX file? How?

I'm a coldfusion developer working on a reporting application to display information from a CFSTOREDPROC process. I've been able to get the data from my query to display correctly in a CFGRID, and I'm really happy with the display of the data. The grid saves a lot of time because it avoids using the CFOUTPUT tag and formatting the data in HTML for hundreds of reports.
All I would like to do is add a simple Disk Icon somewhere on the datagrid control that would save the contents of the datagrid and export it into an XLSX(2010) file that an end user could then manipulate in a spreadsheet program. This is important because the data needs to have a 'snapshot' at certain times of year saved.
Solutions Tried:
I looked into having a link from the report options page that would fire into a report_xls.cfm page but designing a page that catches all of the report options a second time seems dumb and would add thousands of CFM's to the website.
CFSPREADSHEET seems not to work for a variety of reasons. One is that the server seems to constantly fight me with the 'write' function in this tag. Another is that I don't know how to make the javascript work for this button to get the output that I want.
I also looked into doing this as a Javascript button that would fire based on the data entered. Although the data from a CFSTOREDPROC will display correctly if I use a CFOUTPUT block, CFGRID seems to have a hard time with all output styles except HTML. This has caused some difficulty with these solutions because the application doesn't spit out a neat HTML table but instead sends a javascript page section.
Raymond Camden's blog contains an entry Exporting from CFGRID that we used in our project.
The example in the article exports to PDF, but it is rather simple to modify the download.cfm file to export to Excel files as well:
You modify the file to generate the <table>...</table> HTML from his example in a <cfsavecontent variable="exportList"> tag, so that the #exportList# variable contains the table that will be shown in the spreadsheet.
Next we have a URL parameter mode that determines whether it is exported to PDF or Excel.
So the end of our download.cfm looks like the following:
<cfif url.mode EQ "PDF">
<cfheader name="Content-Disposition" value="inline; filename=report.pdf">
<cfdocument format="pdf" orientation="landscape">
<cfoutput>#exportList#</cfoutput>
</cfdocument>
<cfelse>
<cfcontent type="application/vnd.ms-excel">
<cfheader name="Content-Disposition" value="report.xls">
<cfoutput>#exportList#</cfoutput>
</cfif>

Resources