locked
End User Report Type Page RRS feed

  • Question

  • User-1025482824 posted

    I am currently working with Microsoft sql server ,Visual Studio, and asp.net to create a price list type website. I have a MVC for each table in my database.

    I want to create an end user page that displays data about a specific product type. For example I have a table in my database named "Models" and one of the Model names is "JU8900", I would want to create a page where a user can use a search box(I know how to create a search box) to search and display the data(name ,price ,etc.) in an aesthetically pleasing manner all the variations of the JU8900 model. Maybe in some sort of chart or table form?

    How would I go about creating this page and maintaining the same data integrity from my database?  Does anyone have any suggestions or maybe point me to a tutorial that has done something similar. It almost seems like I would just have to craft something using html and CSS, but is there a better way and would I keep my data integrity or would I have to have static data?

    Thank you in adavance

    Wednesday, June 13, 2018 8:12 PM

Answers

  • User283571144 posted

    Hi ruby888,

    ruby888

    I want to create a page where the user can search "JU8900"  and all the different variations of "JU8900" will appear from SQL server.

    If you want to select all the data according to the column name, I suggest you could use ASP.NET ADO.NET to achieve your requirement.

    It could connect to the sql server and select the data according to your requirement.

    About how to use ADO.NET and show table in MVC, you could refer to below article:

    http://www.compilemode.com/2016/09/show-multiple-table-data-on-view-in-asp-net-mvc.html 

    ruby888

    what I'm asking is how to make sort of a end user printable page that spits out reports in a table or chart design. 

    Do you mean you want to make your table could be printed by user in MVC?

    If this is your requirement, I suggest you could consider using javascript to achieve your requirement.

    You could firstly create a new page with the table you want to print and use window.print() method to open the print window.

    More details, you could refer to below test demo codes:

    <html>
    <head>
        <title></title>
    	<meta charset="utf-8" />
        <script src="Scripts/jquery-1.12.4.min.js"></script>
        <script language="javascript" type="text/javascript">
        function PrintRadGrid(divId) {
            debugger;
            var divToPrint = document.getElementById(divId);
            var newWin = window.open('PrintDiv', 'Print-Window', 'width=920,height=750,top=100,left=100');
            newWin.document.open();
            newWin.document.write('<html><title>Invitation Status</title><head><style>#in {display:none}</style><body   onload="window.print()">' + $("#divToPrint").html() + '</body></html>');
            newWin.document.close();
            setTimeout(function () { newWin.close(); }, 10);
        }
    
        $(function () {
            $("#Test").click(function () {
                PrintRadGrid("$divId");
            });
        });
        </script>
    </head>
    <body><div id="divId">
        <div id="divToPrint">
            <table id="myt" frame="box" rules="all" cellpadding="2">
                <tr>
                    <td>aa</td>
                    <td>aa</td>
    
                </tr>
            </table>
        </div>
    </div>
      <input type="button" id="Test" value="Print" />
    </body>
    </html>

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 15, 2018 3:31 AM

All replies

  • User283571144 posted

    Hi ruby888,

    For example I have a table in my database named "Models" and one of the Model names is "JU8900", I would want to create a page where a user can use a search box(I know how to create a search box) to search and display the data(name ,price ,etc.) in an aesthetically pleasing manner all the variations of the JU8900 model.

    According to your description, I couldn't undretand clearly about your requirement.

    What do you mean you want to trance the variations of the Model's price from sql server?

    Do you mean you want to trance the Model's price realtime or just select the price history of the Model's price?

    Have you created a column to store the variations of the Model's price?

    If you could post more details information, it will more easily for us to understand your requirement.

    Best Regards,

    Brando

    Thursday, June 14, 2018 5:03 AM
  • User-1025482824 posted

    Hello and thanks for your response.

    I would want to have a page that does indeed use data real time from SQL server and I have created a column to store the model's price. 

    I want to create a page where the user can search "JU8900"  and all the different variations of "JU8900" will appear from SQL server. I guess what I'm asking is how to make sort of a end user printable page that spits out reports in a table or chart design. 

    Sample being:

    NAME PRICE AVAILABILITY
    JU8901 76,000 local
    JU9834 65,000 central

    Then also somehow connecting another table called "options" that displays all the options that go with each model? 

    Let me know if you have further questions. 

    Thursday, June 14, 2018 2:52 PM
  • User283571144 posted

    Hi ruby888,

    ruby888

    I want to create a page where the user can search "JU8900"  and all the different variations of "JU8900" will appear from SQL server.

    If you want to select all the data according to the column name, I suggest you could use ASP.NET ADO.NET to achieve your requirement.

    It could connect to the sql server and select the data according to your requirement.

    About how to use ADO.NET and show table in MVC, you could refer to below article:

    http://www.compilemode.com/2016/09/show-multiple-table-data-on-view-in-asp-net-mvc.html 

    ruby888

    what I'm asking is how to make sort of a end user printable page that spits out reports in a table or chart design. 

    Do you mean you want to make your table could be printed by user in MVC?

    If this is your requirement, I suggest you could consider using javascript to achieve your requirement.

    You could firstly create a new page with the table you want to print and use window.print() method to open the print window.

    More details, you could refer to below test demo codes:

    <html>
    <head>
        <title></title>
    	<meta charset="utf-8" />
        <script src="Scripts/jquery-1.12.4.min.js"></script>
        <script language="javascript" type="text/javascript">
        function PrintRadGrid(divId) {
            debugger;
            var divToPrint = document.getElementById(divId);
            var newWin = window.open('PrintDiv', 'Print-Window', 'width=920,height=750,top=100,left=100');
            newWin.document.open();
            newWin.document.write('<html><title>Invitation Status</title><head><style>#in {display:none}</style><body   onload="window.print()">' + $("#divToPrint").html() + '</body></html>');
            newWin.document.close();
            setTimeout(function () { newWin.close(); }, 10);
        }
    
        $(function () {
            $("#Test").click(function () {
                PrintRadGrid("$divId");
            });
        });
        </script>
    </head>
    <body><div id="divId">
        <div id="divToPrint">
            <table id="myt" frame="box" rules="all" cellpadding="2">
                <tr>
                    <td>aa</td>
                    <td>aa</td>
    
                </tr>
            </table>
        </div>
    </div>
      <input type="button" id="Test" value="Print" />
    </body>
    </html>

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 15, 2018 3:31 AM