Please note, this is a problem that has been solved repeatedly, most notably by Cellophane
I’m not trying to replace Cellophane, but I’ve got slightly different needs, and I want to show the full how to on how to write a Cellophane-lite application, something which I’ve been doing with Powershell at a few places already.
This is an out of hours project, like pretty much everything else here, (Some of the API support information comes from in-hours billed work, so that’s more proactive than others).
So far I’ve gotten this far, I’ve written the Winform in Microsoft Visual Studio (Community), and it can capture the data I want on screen.
Most important thing I learnt so far? TabOrder!
Answer to first question: Why is the Schedule for Everyday,or specific weekdays?
- I evolved the data structure underlying this app as I went, and I’ve only ever been asked for everyday or once a week reports by clients.
- As a consequence of the above, the data structure currently interprets 0 as everyday, and other numbers as days of the week.
Strictly, I may actually need to fix this before I finish to make it completely portable, because I’ve been relying on really naive assumptions about the Start of Week setting in SQL Server both being:
- The same for every client
- Never changing.
Neither of which I should rely upon, so I suspect I’ll be changing this before I finish the project.
I’ll be posting up more as I learn (probably) and a full write up when I have a finished app (including source code). If you need this for some reason, I guess you can wait for my nerdiness to pay off for you, or you can contact Focus to hire my services.
Project Task process so far:
- COMPLETED – Half Hour. Decide on a development environment (Selected Microsoft Visual Studio – Community on recommendation from a developer friend, and because I understand that Powershell is basically .NET/C#)
- COMPLETED – 2 Hours Make the data entry fields. (I’ve completed my design in Winforms as far as having a form I can type in. Currently the button doesn’t do anything.
- COMPLETED – 1 Hour Formalise Project Plan (Admitting that I didn’t really start with a plan, just an idea. This took about an hour, and was completed as a matter of making this blog post.)
- UP NEXT – Code the business logic/errors into the Schedule report button
- Code the translation of the data fields into what I want to give to the underlying database table
- Sort out a “Configure Database Connection” button to allow for selecting database targets.
- Code the button event that creates scheduled reports into the table
- Sort out a “Create Database Structures” button
- Code an error into Schedule Report that says to create the structures
- Create a “Configuration” file that the Powershell script can refer to
- Set the Powershell script to refer to the configuration file, rather than being hard coded to individual databases
- Translate the Powershell script into C# so I can make a compiled application that gets scheduled, instead of a Powershell script that gets scheduled.
- Writeup of project, including how my code came to look the way it does, and ways you can do this yourself. I’ll probably include a couple of versions of my powershell script as an example.
Note, this project is all about Scheduling MYOB EXO Business’s Clarity report writer to create PDF files for sending.
Clarity is a branded UI thrown on top of Digital Metaphors ReportBuilder, a Delphi Report Writer. I do a fair amount of work in Clarity, because it comes with the application I mostly consult on. It has it’s limitations, like many things, you can probably define your own methods around how to get data.