Reposting your question in a general forum will only serve to annoy the people who answer questions here, because you're duplicating work. Particularly so when you have completely ignored the advice you were given in response to your previous post!
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
So I wasn't sure whether to post this here or in the database section, but here it goes. I have a 'logbook' that I'm developing which is basically a simple message board. Where I'm drawing a blank is how to format the data coming out of the database for the printable report. The database is set up so that all the messages are stored with various headers and a parent/child structure in a single table. You can have multiple child replies to a single parent, but only 1 level deep. Where I'm drawing a blank is how to structure the data for use in the printable reports. Any help would be massively appreciated as I'm drawing a blank as to which direction to go with this.
Here's the desired report structure[^] and the current data format[^]
From your post it is difficult to understand what you want to achieve or what the problem is.
If it is a single table, I'm unsure what you mean with "how to structure the data". Linking the records seems (from your text) easy enough. What's the report for? What data should be on there? For whom is it? You're not asking for a report structure, or are you?
Much clearer, thank you.
I'm not sure what everyone has against Crystal Reports, I worked with it and never had any issues.
I think from the other answers a quick tutorial is indeed a good idea. Many report builders allow grouping/summaries and even graphs on the fly. Playing with it is the best way to learn.
Not sure about other reporting tools, but Crystal Reports allows basically two ways of fetching data. You select data from .Net and pass it to the report document allowing more dynamic control or (my favorite) you build a template and just pass some parameters from .Net to it. The report document will fetch the data itself and build the report. (advantage is that you can test the report outside your application)
Concerning the report format I can only give the advice what I always do. That's asking yourself what is important. I use the 7 seconds rule. The first thing any user asks himself when seeing a webpage, a report, a document, ... is "What am I looking at". Attract their attention with showing what the report is about. The next 7 seconds are navigation. The user passed the first 7 seconds and now wants to know how the thing is constructed. (layout, where is which data, etc ...) After that you have their attention and only then will they look in detail.
(PS: I say 7 seconds, it could be 3 or 5 or 2.45, but you get my drift)
I suggest you consult the documentation for the (Sql Server / Visual Studio) Reporting Services and do one of the "walk-throughs".
That will take you through:
1) Starting the report designer / builder
2) Specifying a data source (I.e. database tables)
3) Selecting records
4) Fields to report on
8) Parent-child reporting
I'm with Gerry on this, pick a report builder and use that, anything except Crystal Reports. We us SSRS and it does all you need but then so do ALL other reporting tools. Parent/Child structure are the bread and butter of reporting.
Never underestimate the power of human stupidity
I have a C# program that calls various PowerShell scripts as it runs. If I run the program as an administrator, it doesn't seem to pass on the elevated rights to the runspaces used for executing the scripts.
Is there any way to do this? The code I am using to run the scripts is below:
Would this help - Passing credentials ? (note, obviously its dangerous to store the password plain-text, Im not suggesting that as a long-term thing, but test it, if it does what you want, think about handling the password 'securely' - maybe there's a similar way of getting and using the local credentials if you're already signed on as Administrator)
(this is the guts of what you need to do to your code)
// Assumes String username// String password// String computername - use '.' for the local computer//var credentials = new PSCredential(username, ConvertToSecureString(password));
var connectionInfo = new WSManConnectionInfo(false, computername, 5985, "/wsman", "http://schemas.microsoft.com/powershell/Microsoft.PowerShell", credentials);
var runspace = RunspaceFactory.CreateRunspace(connectionInfo);
Take out the GC crap. It's really not helping that much and, by the description you gave, will actually hide the problem, not fix it. From what you've said, it sounds like there's some other object you have to Dispose, but haven't, before it goes out of scope or you're constantly adding to a collection. There really isn't that much code here. I don't know where that logger is going to but it may also be the problem.
Get a memory profiler[^]. It'll tell you what type the objects are that are taking up all that memory and give you a clue as to what to look for.
I switched to a more passive mode a couple of years ago; I'm still reading a few CP articles each week, but I stopped my forum activities, lacking a sufficient number of decent questions since mediocrity introduced by QA started infecting the forums too. However, when I see something worthwhile in C# or algo forums, I occasionally post a bit. So, no, not really a return, just passing by.
lacking a sufficient number of decent questions since mediocrity introduced by QA started infecting the forums too.
I hear that! The number of "questions" where the OP doesn't know what a computer is let alone how to write code for one just keeps growing and growing. The Copy'Paste'n'PrayItWorks coders are outnumbering the good questions by a large margin now-a-days. Too many people find it easier to ask someone to do their work for them or fix their code for them and won't even bother to set a breakpoint let alone look at variables in the debugger. It's really sad.
It's wearing pretty thin on me too. I weep for the future of software development.