next month I will begin to develop a project and I'm studying about that (I'm a novice).
In this project I will create many report storing data from a Database so I'm concentrating about how print the report using WPF. I need to use many features as follows: page header, page Footer, multi page, page number and so on.
I ask you if you can give me any useful advice, links, suggestion, tools etc. to help me how print in WPF with good results, sincerely I have not good knowledge about that.
Thanks for your time.
It seems you are concerned with two things: printing, and reporting.
If it is a simple matter of printing, then there are other questions out there that may help.
If you are concerned primarily with reporting, or managing and printing reports, then you want a reporting framework.
If you have licensed SQL Server 2005 or later, you may want to check out SQL Reporting Services. You can use SSRS regardless of whether the data is stored in SQL Server.
The suggestion in the comments to your question - to view this prior SO question - still seems like a good one to me. It is nearly an identical question.
Related
First of all sorry for what may seem as dumb question, but I have zero experience in that area.
So at work I was given a database (which is way more normalized than needed) and for each Insert/update/delete/select I have a separate stored procedure.
As someone with zero experience I started creating my own stored procedures and displaying text instead of ID and it was all going well until I realized I have to update this records at some point :).
So my question is can you give me directions on how to display "eye-friendly" information in the GridView and at the same time be able to edit/update this information?
Currently what I am doing is just calling a stored procedure and databind the grid view to it.
Thanks in advance!
Study time! I would like to explain this to You directly, but it is much more useful to already made tutorials, which have needed information. And this topic would be so rich, it would be hard to explain in just few sentences/examples.
The best option is to use tools/classes that .NET provides to You. Among them there is DataSet, which will incredibly help You out with all set of modifications deletes/selects.
You can bind DataSource to GridView, which will autofill data and You can just allow some kind of modifications to it.
Other approach is to use EntityFramework, where You can modify data in ways You want - it will do a lot of work for You.
Latest topic You should be interested in is LINQ - simple get data & do some queries/modifications in Your app (not at SQL server).
Check links below:
What is ADO.NET?
http://www.entityframeworktutorial.net/what-is-entityframework.aspx
Also recommending this YT video, be careful about video/sounds quality. Try some other videos with similar name.
http://tutorialspoint.com/linq/
I know there are a thousand data import related questions on Stack Overflow, and please accept my apologies if this has already been asked somewhere, but I wondered if anybody could advise of any tried and tested solutions for normalisaing data during an import from CSV/Excel in C#/ASP.NET MVC 3+.
I could code something to do the job but wondered if there were any open source libraries or tools which could help out with this.
My area of interest is as follows:
When importing data, I occasionally need to normalise some fields, a simplistic example of this is shown below:
My input may be:
Name, JobTitle
==============
Nick, Manager
Dan, Coder
My table structure may be
Name, JobTitleId
================
Nick, 1
Dan, 2
If a job title doesn't exist, I'd like it to be created in my JobTitles table and the Id to be returned. If it does exist, I'd like to store the ID.
In sumamry, my questions are:
Is there a technique or approach I should be taking to do this?
Are there any open source/commercial libraries out there which handle this - no point in re-inventing the wheel
Is there a technique or approach I should be taking to do this?
The simplest technique that I can think of is a non-MVC way: use SSIS!
You can have ASP.NET as the middle man to accept the Excel file and pass it to the database if security is a concern. There are many tutorials out there using Excel Connection Manager. e.g., Import Excel File.
SSIS gives you incredible flexibity which might help you normalize your data.
Are there any open source/commercial libraries out there which handle this - no point in re-inventing the wheel
As you might already have invested in Microsoft products like Visual Studio and SQL Server, you might as well leverage them to suit your needs than trying out open source products out there.
Sigh!!
Besides that, if you really wanna check out tools, then I have heard people recommend these ones (not used any of them):
RelationalExcel but it is not free.
ExpertXLS Excel Library for .NET - this one is not free but works with ASP.NET.
This blog seems like a good reference to tools that he has tried.
Other alternatives could be:
Load your Excel using .NET into datasets and generate your SQL queries dynamically OR pass this to an SQL Server sp that does the heavy lifting
Parse your Excel using VBA and then use it as a data source to ASP.NET
I'm working on somekind of "social network" and have created my own comment system for every post, since large number of posts and comment is expected I'm not sure if sql is the best approach here.
Currently I have two tables on Sql db:
Posts:
Columns: ID,PostText,DateTime,Username(that posted)
Comments:
Columns: ID,PostID(post which it belong),CommentText,DateTime,Username(that Commented)
I would also like to implement "Like system" but then I would have to make new table?
exemple:
Like:
Columns: ID,PostID,Username(that liked) - to prevent double voting
There might be alot of refresing and I'm little worried that Sql might start giving me headaches with high traffic on website.
But I need advice from someone that had experiences with both sql and permalinks.Which works better given that permalinks have ability to be crawled for links. Im also not sure if large number of files(permalinks) would be trouble for my host.
If you think permalinks are better can you explan a way to format them and sort somehow using folder hierarchy since I've never worked with it.
Thanks!
You really need a new table for likes.
I think if you have high traffic, you should have an additional history table and you have to keep old likes (for example older than a week) here or try to partition your table.
But these will the first steps there will be a lot of work with really high traffic sites.
Morzel
Thanks in advance for any assistance. It seems like what i'm trying to do should be very simple, but after literally days of scouring the internet I can't seem to find an answer that pulls it altogether in a simple fashion suitable for an experience .Net developer who is new to the Report Viewer.
Very simply, what I want is an example or step by step demo for the following question:
How do I populate a .Net Report Viewer control using a Data Table returned from a web service? Within the web service a stored proc is called that returns what eventually ends up in the DataTable that gets sent back to the application. Would prefer C# answer, but VB is also fine as i am fairly familiar with it.
Related questions to this are:
1. Does the returned DataTable need to have column names and types (does it need to be strongly typed)?
2) If so, do I need to know these column names/types when I am designing the report or is there a way to dynamically create?
If you're doing a client side report (rdlc), then I would recommend writing a class that holds that data for a row, and binding the datasource (report.LocalReport.DataSource I believe) of the report to a collection of that type. You can do datasets (which you could put your data table in), but, in my opinion, that mucks up a project and I don't care for it. I know you're looking for a step-by-step answer, and hopefully someone will give you one, but hopefully my response will get you to change direction a bit.
If you're talking about a server side report (rdl), then you'll need to redo your thinking a bit, as server side reports PULL data, they do not have data pushed onto them.
HTH,
Brian
I never thought I'd ever say this but I'd like to have something like the report generator in Microsoft Access. Very simple, just list data from a SQL query.
I don't really care what language is used as long as I can get it done fast.
C#,C++,Python,Javascript...
I want to know the quickest (development sense) way to display data from a database.
edit :
I'm using MySQL with web interface for data input. I would be much better if the user had some kind of GUI.
Depends on the database -- with [sqlite][1], for example, ...:
$ sqlite3 databasefile 'select foo, bar from baz'
is all it takes (see the URL I pointed to for more options you can use, e.g. to change the output format, etc). Mysql has a similar command-line client (see e.g. here), so does PostgreSQL (see here), etc, etc.
So, what specific DB engine are you concerned with? Or, if more than one, which set?
Some suggestions:
1) ASP.NET Gridview
---use the free Visual Studio to create an asp.net page
...can do VB, C#, etc.
---drag/drop a gridview control on your page, then connect it to your data and display fields, all via wizard (you did say quick and dirty, correct?). No coding required if you can live within the wizard's limitations (which aren't too bad actually).
The type of database (mySQL or otherwise) isn't relevant.
Other quick and dirty approach might be Access itself -- it can create 'pages', I think, that are web publishable.
If you want to put a little more work into it, ASP.NET has some other great controls / layout capability (non-wizard derived).
Also, you could look at SSRS if you have access to it. More initial setup work, but has the option to let your users create their own reports in a semi-Access-like fashion. Web accessible.
Good luck.