anybody know how to print msflexgrid and the data contain in this flexgrid. I want to know how to print this flexgrid into my printer.
thank in advance.
I would also like to know if this can be done.
You need to use reports like Datareport or Crustal report for reportin g purpose. That gives you better options like data foramtting etc.
I would also like to know if this can be done.
Regarding printing of msflexgrid and the data inside the cell address of grid it is possible to print. There is a source code for this syntax in this address: www.planet-source-code.com
You can print the msflexgrid and its data.
Just type the printing msflexgrid for search and Visual basic for language to search it faster..
Have a nice day!
This is the way how you can take out data from FlexGrid
For i = 0 To Form1.MSFlexGrid1.Col For j = 0 To Form1.MSFlexGrid1.Row Print Form1.MSFlexGrid1.TextMatrix(i, j) Next j Next i
does it print the grid lines also???
No, I would also like to know how to do that.
So far I used for printing lines statment:
I get requests to print boxes around text.
it would take a lot of work to accomplish.
try to export values into excel sheet.
I may try that sometime.
thanks for the idea.
Let's try this code.. I've been using it and it works excellent!!
Private Sub cmdPrint_Click() 'Print the grid with the top row as a title row FlexGridPrint Me.Grd, , , , , 1 End Sub
And also this..
Function FlexGridPrint(Grd As MSFlexGrid, Optional lOrientation As Long = vbPRORPortrait, Optional ByVal lMaxRowsPerPage As Long = -1, Optional lTopBorder As Long = 1000, Optional lLeftBorder As Long = 1000, Optional lRowsToRepeat As Long = 0) As Boolean Dim lRowsPrinted As Long, lRowsPerPage As Long Dim lThisRow As Long, lNumRows As Long, lImageHeight As Long, lLastImageTop As Long Dim lPrinterPageHeight As Long, lPagesPrinted As Long, lHeadingHeight As Long On Error GoTo ErrFailed Grd.TopRow = 1 lNumRows = Grd.Rows - 1 lPrinterPageHeight = Printer.Height lRowsPerPage = lMaxRowsPerPage lRowsPrinted = lRowsToRepeat If lRowsToRepeat Then 'Calculate the height of the heading row For lThisRow = 1 To lRowsToRepeat lHeadingHeight = lHeadingHeight + Grd.RowHeight(lThisRow) Next End If Do 'Calculate the number of rows for this page lImageHeight = 0 lRowsPerPage = 0 'Setup printer Printer.Orientation = lOrientation For lThisRow = lRowsPrinted To lNumRows lImageHeight = lImageHeight + Grd.RowHeight(lThisRow) If lRowsPerPage > lMaxRowsPerPage And lMaxRowsPerPage <> -1 Then 'Image has required number of rows, subtract height of current row lImageHeight = lImageHeight - Grd.RowHeight(lThisRow) Exit For ElseIf lImageHeight + lTopBorder * 2 + lHeadingHeight > lPrinterPageHeight Then 'Allow the same border at the bottom and top 'Image is larger than page, subtract height of current row lImageHeight = lImageHeight - Grd.RowHeight(lThisRow) Exit For End If lRowsPerPage = lRowsPerPage + 1 Next 'Print this page lPagesPrinted = lPagesPrinted + 1 If lRowsToRepeat Then 'Print heading rows Printer.PaintPicture Grd.Picture, lLeftBorder, lTopBorder, , lHeadingHeight, , 0, , lHeadingHeight 'Print data rows Printer.PaintPicture Grd.Picture, lLeftBorder, lTopBorder + lHeadingHeight, , lImageHeight + lHeadingHeight, , lLastImageTop + lHeadingHeight, , lImageHeight + lHeadingHeight Else 'Print data rows Printer.PaintPicture Grd.Picture, lLeftBorder, lTopBorder, , lImageHeight, , lLastImageTop, , lImageHeight End If Printer.EndDoc 'Store printer position lRowsPrinted = lRowsPrinted + lRowsPerPage lLastImageTop = lLastImageTop + lImageHeight + lHeadingHeight Loop While lRowsPrinted < lNumRows FlexGridPrint = True Exit Function ErrFailed: 'Failed to print grid FlexGridPrint = False Debug.Print "Error in FlexGridPrint: " & Err.Description End Function
Ops..forgot to mention.. Grd is the name for that MSFlexGrid..
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...