Display data in a pop-up and print the page - html

By clicking on a button named " generate report" or "summarize" some sort of pop-up would show summarizing the collected data showing value like average, total, etc... it also comes with a graph. On the corner of the page displaying summarized results there would be a print button to print the summary page
How would I open a new window/tab or some sort of section to display the report?
And how would i be able to print it in the same format as it is?

You can use jQuery UI dialog to create modal popup. Inside of this dialog you can put everithing you need. But if need to pring it - better create in js new window and put information there:
window.open();
To print browser window content just call in onClick for your button:
<input type="button" value="Print" onClick="window.print();" />
For graphical information I prefer jqPlot. Try it - that is nice tool. See demo here.
If you need high quality printing than generate pdf or xlsx. If you use java and tomcat you can easilly integrate JasperServer to your application.

Related

Web page button to pass value to excel spreadsheet displayed on another page

is there a way to add several simple buttons to a web page that when pressed by a user, adds a fixed value to cell in a spreadsheet viewable on another page,on the same site, without viewing that other page. I would also like that to be the only way to add any data to that spreadsheet.
I Have been asked for more information. so i have included the code i have so far, which works fine however i would like to change where the change is outputted to.
I would like the word "Press" to be in a cell on a spreadsheet on another page on the same site and for that word to change to the word "Pressed" when the button is pressed.
<body>
<!-Changing the text->
<button id=" Button1 ">Press Me</button>
<div id=" firstTxt1 ">Press</div>
<script>
// Changing text script
document.getElementById(" Button1 ").onclick = function (){
document.getElementById(" firstTxt1 ").innerHTML = "Pressed";
}
</script>
</body>
For a web Page html only solution is not the normal way. Generally, a web app would be used instead to communicate events between different views - something like a dotnet core web app.
In your case it seems you have 3 elements:
"data entering" html web page,
spreadsheet,
"data" viewing html web page.
How you interface with the spread sheet depends on the type of spreadsheet you are using, and where it is located.
if it is a google sheet, this answer might help
spread sheet button with java script.
The question lacks a lot of detail, and is very general, but I hope this helps you get started

VBA ACCESS - SQL statement after Print

In my DB i have a table called "PrintList" populated with a random number of records and a report called "ReportList", which is linked to "PrintList", that is used to print all the records of the table above.
EDIT: I would let the user to see a print preview in Access to check the list and then choose if print it or not, so i prefer to avoid using code to print.
Is it possible to handle the "ReportList" print event and delete all "PrintList" records after the report is printed? Right now I use a button to empty the list via SQL, but it will be more useful to empty it after printing it.
Report/section events like On Format or On Print are fired both for Print Preview and for actual printing. So the report doesn't know, and thus can't handle your requirement.
I'd use a form with buttons for Preview and Print, and delete the records when the form is closed (because you can't prevent the user from printing from the preview).
The whole requirement looks a bit strange, TBH.
Open your report in design mode.
If the properties pane on the right isnt visible, press F4 to make it visible.
In the properties pane, click on the Events tab.
Find the OnPrint event and click the little ellipses to the right of it to open a VBA window ready to accept your code for that event.

SSRS PopUp Message Box

Ive had a request from a client to make a popup box appear on the click of a databar within an SSRS report. Not had any luck with various Google Searches and just wanted to know if anybody has either got this work directly or has any suggestions for a workaround they have used?
Bit of background on the actual report itself, it simply contains a table with various stacked DataBars showing comparable data between multiple users in a system. The ability is needed to click a bar and see which User that bar relates to.
Any suggestions are appreciated.
It's not quite the same thing, but you can use the SSRS tooltips functionality to achieve something similar, i.e. a user will hover over a part of a chart and some contextual text information will be displayed.
Show ToolTips on a Series has some further information.
You can add an action to an object with a javascript popup which can show a specific URL or another report. In the action click on Fx to set an expression as follows:
I used a different script to popup a URL which contains an image url from the database:
="javascript:void(window.open('" + Fields!ImageURL.Value + "', null, 'width=800, height=500, status=no, toolbar=no, menubar=no, location=no'))"
( you can replace Fields!Image.Value with a url , this is the URL from a database field)
a
On a PC this will showup properly sized as a popup. On an iPad it will appear as a new tab.

incompatible type passed in as a parameter created by loading a GUI component.

I am having a problem with a UI that I am building in a Google Spreadsheet. I will First explain a little about how it works and than I will get to the problem. The UI is fairly simple program that connects to a SQL database, it allows users to create new records, Query, search, and render reports. I have created all the panels (eg the intro page, the create record) in the GUI builder. As the user navigates through the UI I swap out a Grid with the new panel that i want the user to see. For example on the intro page there is a create button when the user clicks the button the gird where there intro panel was is replaced by the create record panel. I have created two ways for the user query/search for data. The first way is to select a number range on the intro panel and click the Query button. This will than query the last 10 or so records into a GUI built Panel that I will call MainForm. The second way is to "search" for a job. On the intro page there is a search button when the user clicks with button it goes to a new page; the grid is switched to the search panel. On the new page/panel the user can put in some parameters to search for. After the user clicks the search button the program should load the search results into the MainForm in the same way as when you Query from the intro page. I have taken the whole function apart line by line, so i am sure that the issue has to do with loading the panel/Component. What i mean by that is these few lines of code.
var Component = app.loadComponent("MainForm");
var panel = app.createVerticalPanel().setSize("770px", "900px").add(Component);
app.getElementById("contentGrid").setWidget(0,0, panel);
But why would it load in one case, but not in another? Also it is not the method of loading the Component, rather it is the returning the panel/ Component.
To Summarize, When I load the Component with the query function it works, but when i load the Component in the search function I get and error: Incompatible type passed in as a parameter. Also I load the MainForm Component in two other functions as and it works most of the time, but some times I get the same error.
I think your approach is not ideal, load component is not supposed to be called multiple times. It would be far more efficient to get all your panels in the same compnent and play with visibility of each panel to show / hide them on demand. Each panel should be inserted in a vertical panel so that the "new panel" slips to its place when the "old one" hides.
An example of this approach is shown in this post to simulate tabs and could easily be adapted to your needs.
btw, this method is also very fast and responsive since the full UI is ready from the very beginning ;-)

jQuery tab content loaded from PartialView using Ajax

I am loading 2 jQuery UI tabs with data from ASP.NET MVC 3 PartialView using $.ajax(). I am specifying the '/controller/action' as URL. This works fine and I am able to load the two tabs with content returned by the partial views.
I have a Save button in the _layout.cshtml.On clicking the Save button, I want to get data from all tabs and send it to the controller as a JSON object.I want to use only one Save button for saving all data in the tabs instead of having Save button at the bottom of each tab.
The problem is I am able to get data from only the first tab. I get 'No Source Available' error when I try to get data from the other tab. The $('#some_id').change() event is also not fired for the controls in the second tab.
Please suggest if there is a better way to implement this ?
I would also like to know why the HTML generated by PartialView is not seen when I view source HTML of the page ?
Thanks.
It turned out to be an issue of async requests that were being made to load the tabs. I used the load() of jQuery tabs to resolve this.