Showing posts with label base. Show all posts
Showing posts with label base. Show all posts

Friday, March 30, 2012

How to get total page count for individual groups

Hello,

I have report in which I have created groups base on the customer name. Can anybody please tell me how to get the total page counts for the individual group? I have page break after every new group and I am able to reset page count to 1 when new group start but I am getting the total number of pages for a particular group.

For ex, let say I have 4 groups, 1 group has 3 page, 2 group has 2 pages and 3 group has 6 page and 4th group has 7 pages I need something like,

For 1st group

'Page 1 of 3’ when user click next page it should be 'Page 2 of 3' etc

Similarly for other groups as wll.

Thanks!

Hello,

Brian Welcker has a blog post that covers this:

http://blogs.msdn.com/bwelcker/archive/2005/05/19/420046.aspx

but you will want to modify his code slightly to use a hash table as he notes at the end.

Let me know if you need assistance implementing this solution or if this doesn't solve your issue.

Larry

|||

Hi Larry,

Thanks a lot for the reply.

I am able to implement the code but I am not able to get the total page count for the individual group.

Let say there are total 15 Pages in the report and there are 3 groups with page break then I need something like

For Group 1 paging would be -> Page 1 of 3, Page 2 of 3.....etc

For Group 1 paging would be -> Page 1 of 5, Page 2 of 5, Page 3 of 5...etc

For Group 1 paging would be -> Page 1 of 7

Currently I am getting like

Group 1 - Page1 of 15, Page 2 of 15...ect

Group 2 - Page 1 of 15, Page 2 of 15..etc

Group 3 - Page 1 of 15, Page 2 of 15..etc

Thanks

|||

I see. I didn't fully read your original post. Take a look at the following thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

where Lisa posts a method of doing what you want. It requires some external code as the pages in a report are rendered in a single pass and it would require two passes (one to count and one to update) to accomplish what you are wanting.

Larry

Wednesday, March 28, 2012

How to get The Standard Query Languages general standard?

:) I wanna find a general standard in some database like ms sql,oracle,sybase..This standard is a rfc or another document which declared the base role how to work with sql..
Can u give me any thread??The only SQL standards that I recognize are the ISO SQL Standard (http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=34132 &ICS1=35&ICS2=60&ICS3=&scopelist=) and the ANSI (http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC+9075%2D2%2D2003 ) standard.

-PatP|||I'm not too sure how much use buying one of the standards would be, as meritoriuos they are. Virtually no server meets the (most recent) standards in their entireity, AND most servers have there own extensions and variations on the standard. So either, you use the reduced common set applicable to all db's, or get a specialist book on the db you are working with.

Personally I found the O'Reilly "SQL in a nutshell" a good basic reference But not a primer (it covers MySQL, Oracle, SQL Server (and one other I can't remember)). Its a bit sparse on examples (but that would be the same with a standards manual), but it provides sufficent pointers to jog the memory, or show the way forward. But there are others with masses of text, information and examples. The "in a nutshell" series are probably not the "best" for beginners, don't take offence I've made no assessment of your competance.|||cleverpig, i would definitely buy a book, it is much easier

if you really want to see the standard, you may read a draft of sql-92 here --
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

note that most databases implement most of sql-92

don't spend too much time in there, though, because if you learn something in sql-92 there's no guarantee that it'll work in your particular database|||I'm certainly game with the idea of buying a book. As a general rule, they are significantly easier to read than the standards are!

Just as a note, the standards are what both the database engine writers and the book writers use for a reference. The standard is where they start. If you are looking for a clear, technically correct statement of what is required for a given level of SQL implementation, the standard document is where I would start.

The standard documents might not be suitable for everyone, but why start third-hand (with the interpretation provided by the book's writer)?

-PatP|||depends what cleverpig is trying to achieve. If CleverPig is going to write a SQL database then go to the standards to check what you are doing is correct, if CleverPig is writing some application software accessing a specific SQL engine then go buy a book relevent to that SQL implementation, or buy a book which identifies where varius flavours of SQL implementations vary from the standard and make sure Cleverpig writes code compliant to the lowest common denominator (if you wan ttomake your code protable).

The standard identifies what the server "should" do, but the servers often:- don't do it,
or dont do it the way the standard says they should,
or has implemented some other features not thought of at the time the standard was thrashed out, or has retained some features from previous versions which are not compatible with the current standard
even if they are compliant with most of the standard, they are still not standard compliant. On dodgy ground here but I'm not aware of any SQL implementation which is truly compliant to the satndards.|||:D Thank for your replies..They are very good suggestion about how to get and learn sql standard..
I think the sql standard is a common role,but the some sql implement has his owner's role base on thie sql standard!..
:eek: So we can use it fixable just as you said..

Monday, March 12, 2012

How To Get Rid Of Sql Log

Hi,
I have a Data base on Sql Server 2000, sp3a. Database is used to to build summary tables to show reports on web. There are many sub systems, which prepare summarized tables for faster web page serving. Every thing is working fine.

The problem is sql server log gets full. In one given day it could go up to 18 GB. I know, if I back it up it gets truncated. Is there a way, I can stop sql server not to log, as it is not needed?

Can I set up Sql server to automatically truncate it. I do have auto shrink options checked, but log file still keeps growing.

Any idea, what is going on here.
Thanks,
Mashro::Is there a way, I can stop sql server not to log, as it is not needed?

You err, it IS needed.

Read up in the documentation what the log is used for. It is needed.|||Back it up regularly to keep it from growing out of control. You can't eliminate the log. It's a pretty key piece of the puzzle. If you have the db set to simple recovery, it should truncate the log on each checkpoint. Probably no need to use a full recovery model on a 'derived' reporting database like you seem to have.

Friday, February 24, 2012

How to get IRowsetPosition...

Hello everyone.

I make the IRowset form IOpenRowset::OpenRowset() method because I want to use the base type cursor, scrollable and updatable.

But I don't know how to get the IRowsetPosition in this case..

I want to know the current cursor position after calling IRowset::GetNextRows().

I'm developing MFC application using OLE DB interface in VM5.

Thanks in advance..

You could read the identity column?|||When using a base table cursor the best approach to do what you want is to use the bookmark column (at column index 0). You must expose the IRowsetBookmark (if memory serves me well) and then you can reposition the cursor on any bookmark of the open rowset.|||

Thank you..

After posting my question, I updated my code by IRowsetBookmark and it worked.

Now I have the confidence that the way I did is the best.. :-)

Anyway..

Is there no way to get the IRowsetPosition..? just for curiosity