Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I’m created an ASP.Net Razor-Pages  application that allows users to enter data related to a service call they completed.  A supervisor can logon and have access to calls completed by members of his/her team.  The goal at this time is to, 1) Print the records for the current week, or 2) Export the records for the current week in an Excel or PDF  format.  Each record has eight columns, there will be only a few hundred records.

Can either of these options be done using Visual Studio 2017 only?  If so, suggestion on how to print or export the records will be appreciated.  If additional tools are required, what tools should I consider using?


What I have tried:

During the past week I’ve spent hours trying to find answers to these questions on-line, but I have not been able to find a definitive answer with suggestions (steps) on how to print or export the records from the database using ASP.Net Razor-Pages.  I get the impression that Razor-Pages is still such a new platform that maybe this can’t or hasn’t been done yet.  I am probably looking in the wrong sites or asking the question in the wrong way
Posted
Updated 31-Jul-18 6:14am

1 solution

Simple answer is yes; but is never that simple.

You really should flowchart what the goals are at the high level and then detailing each of them items at the low level. I will do a simple skeleton of this, with the numerics being the high level needs and the alphas being the low level questions you will need to figure out along the way.

1. Data Entry
1A: How will this be stored? SQL, Excel, of some file?

2. Data Retrieval
2A: Dependent upon how data is stored.

3. Data Presentation
3A: Report Preview webpage
3B: Export Methods
3B#1 Export to Excel
3B#2 SSRS Report

You will notice that I did not include PDF as an Export Method. That is because a PDF is just a container to place an already formatted document (~report) into.


And then again.... if you have some Excel hotshot that can generate reports within Excel from another page in the spreadsheet, you could open the Excel file and add the data directly onto that page, and the reports would be atomic(real time)
 
Share this answer
 
Comments
Member 8668966 31-Jul-18 13:07pm    
Thanks for your reply. Your are correct its never that simple. I've filled in your flowchart, the process helps me to under how little I know. Based on my answers any suggestions on a good place to start?

1. Data Entry - Users logon to web site, use a web (Razor page) to enter data.
1A. Wow Stored - Data is stored in an SQL database.

2. Data Retrieval - Use a query to get desired records (Could display records on a web page if needed).
2A. ?

3. Data Presentation - ?
3A. Data Preview webpage - Simple columns and rows.
3B. Export Methods - ?
3B#1 Export to Excel - Yes
MadMyche 1-Aug-18 10:49am    
I would probably start with an MVC tutorial; this will cover the main functionally of creating, storing, retrieving, and displaying the data.
"Exporting" is just a subset of displaying the data

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900