krmsmsk / Python_SQL_App

A reporting application where we can query with SQL through the screen I developed with Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Report App

python logo microsoftsqlserver logo flask logo django logo

A report program which we have to meet request from our business lines.

My Aim

Unfortunately, reporting requests coming from various business units are not always satisfactorily met using the tools sanctioned by the bank. In relation to a reporting request that the team has examined but hasn't been able to find a solution for, I will introduce a program that I have developed on my personal computer (as a preliminary effort). The purpose of this program is to address a reporting issue that we have been attempting to resolve using SSRS but have consistently encountered errors.

Summary

I have created three separate functions for essentially the same request that comes from the same business unit but at three different stages. In each query, I retrieve certain parameters (following the logic of SSRS) that need to be used in the SQL query and embed them within the query. Subsequently, I establish a connection to the MSSQL Server and execute the query. I place the output of the query into a dataframe, display the first ten rows (top 10) to the user, and inquire whether they would like to download the entire output as an Excel file. If the user is satisfied with the output and wishes to download it as an Excel file, I upload the file to the bank's shared folder. This way, the business unit can obtain the same result as the report they intend to generate using SSRS.

- Why we need this program?

Because the result of the requested query resides within a significantly large table, and unfortunately, the server hosting this table has been poorly designed. Consequently, fetching information for just one DK_NO takes around half an hour for approximately 200 thousand rows of data. Given this scenario, even a direct SSRS connection struggles to retrieve the results for a single DK_NO. Our team lacks the authorization to intervene with the server, database, or table in question. Therefore, we needed to devise a solution based on the prepared report. Thanks to the program I developed, we can input 4-5 specific DK_NO values into the program all at once and, after approximately 3 hours, obtain the results without encountering any issues.

NOTE :

- The program can only be utilized by our own team.
- The outputs I will show you below are different from those at my workplace. The outputs here are preliminary results developed while creating this program.
- At my workplace, the program is used with an appealing front-end design, incorporating the DJANGO library. I will soon adjust and update my write-up to include the same front-end design for these outputs.

You can review the program's outputs from the images below:

Updated Version...

Old Version...

Sample Code

Place where I downloaded that excel

It is purely coincidental that only 10 rows have arrived. It normally returns all matching data.

About

A reporting application where we can query with SQL through the screen I developed with Python.