VBA to default printer in Crystal Report

is it possible to set default the printer for crystal report to be the same 
as the printer setup in GP (Files>Print Setup)?

eg: is GP is using Printer1, then when calling a crystal report using VBA, 
the printer will be set to Printer1. If GP is using Printer2, then crystal 
report will be defaulted to Printer2.

thks in advance.

0
HFLo (288)
2/7/2007 4:59:00 PM
greatplains 29623 articles. 6 followers. Follow

1 Replies
929 Views

Similar Articles

[PageSpeed] 30

Unfortunately that isn't going to work for a couple reason:

1. The biggest reason is there isn't any way to determine what the printer 
is in Dynamics.  Not even with Dexterity.  It just wasn't something that was 
exposed.  So I can't think of any possible way you are going to get this 
information.

2. Saying that you somehow work around that issue (or just hardcoding a few 
names or something), the other issue is that for Crystal Reports you need 
the Printer Name and for some reason the Driver.  I seem to recall beating 
my head against that a while back.  I know that VB6 and probably VB.Net/C# 
both provide a "Printer" class that you can enumerate the printers with and 
get this information. But VBA (not just Dynamics but all VBA since vba is 
vba in any app) doesn't have that Printer module defined (or Screen or ....) 
as it's just a subset of VB6 really.  So you're kinda stuck there as well.

You might be able to do a few tricks by writing some code outside of VBA 
(like vb6 to wrap a COM class to enumerate the printers) but I don't see how 
you can get around the "current" printer issue.

patrick
mbs dev support

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.


"HFLo" <HFLo@discussions.microsoft.com> wrote in message 
news:A514FF94-72ED-49F7-A97E-41798B0C1D0D@microsoft.com...
> is it possible to set default the printer for crystal report to be the 
> same
> as the printer setup in GP (Files>Print Setup)?
>
> eg: is GP is using Printer1, then when calling a crystal report using VBA,
> the printer will be set to Printer1. If GP is using Printer2, then crystal
> report will be defaulted to Printer2.
>
> thks in advance.
> 


0
prot1 (1345)
2/10/2007 2:47:33 AM
Reply:

Similar Artilces:

Printer does not print all text
For some reason one of my Publisher file is not printing all the text; only about 75% of the text is there. I have tried to print from a different computer but have the same problem. On screen, everything looks right and great. I am using Publisher 2007. Andy help would be appreciated. You might want to check the manufacturer's web site of your printer model for an upgraded driver. If you think your present driver is correct, uninstall it and then re-install. It is always wise to completely remove a printer driver before installing/reinstalling. How to clean up printer drivers...

Run Time Error 2501 "The report action was cancel"
hi I have a access database with some reports. All reports are working fine except one. When I click Priview or Print window I get the error "Report Action was canceled" and the error number is 2501. I try to ignore the error but report does not open. Any help in this regard. Here is my code. Private Sub Command15_Click() On Error GoTo Err_Command15_Click Dim stDocName As String stDocName = "Cash Voucher" DoCmd.OpenReport stDocName, acPreview ComeHere: Err_Command15_Click: If Err.Number = 2501 Then Resume ComeHere End If Any help in this regard ?? Thnx i...

Default Cell format of existing Worksheets got changed automatical
I am using MS Excel 2007. Most of my excel files saved with default cell format as General while creation; currently for the last two days when i open those files the cell content format is showing as currency format. Pls let me how to fix the same If you reference a cell that has a format (other then General), the reference cell will adopt the same format. -- Regards Dave Hawley www.ozgrid.com "NGBalaji" <NGBalaji@discussions.microsoft.com> wrote in message news:297839C7-D769-4623-94F1-2A77FD179E34@microsoft.com... >I am using MS Excel 2007. Most o...

Reporting in CRM help!!!!!!!
Hi guys, It would be great if anyone could help me with this one. In the Sales Pipline report instead of using estimatedvalue for my calculations I want to use another custom field. Does anyone know how this can be done and if so how. I don't want to change any of the functionality of the report just simple change the field that use. My custom field is also a Money field Thanks Will Assuming you are using v3.0, You need visual studio to modify reports. Reports are saved in SQL reporting Services. If you are using 1.2, you customize reports using crystal "Will" wrote: ...

Detailed Sales Report Question
For some reason, on our detailed sales report, the cost and profit are not accurate. I think I've narrowed the problem down to returns because every time we have one, the report shows a negative on Qty sold and total sales, but it still shows the same cost and profit as a sale for that item. As an example, I had a customer buy a charbroiler and return it later that day to buy a bigger one. The Detailed Sales Report shows the first transaction with this information... Qty Sold: 1 Sold Price: 995.00 Total Sales: 995.00 Cost: 694.35 Profit: 300.65 Then, the return shows up with this....

Change Caption in Report
Hi all, I am trying to set up macros based on a huge amount of reports to automatically print the reports all at once. However, I would like to change the caption setting so that I don't have to keep changing the file name each time. Is there a way to do this? I am new to Access so I'm not sure how to set this up. For example, one report is called "rptCountrybySalesParent" and I would like each file to print out like "FrabySalesParent," "ItabySalesParent, "ChnbySalesParent," etc. I have the where conditions figured out, but the cap...

Upgrading reports from CRM 3.0 to 4.0
Having spent around 10 hours trying to upgrade a custom report from CRM 3.0 to CRM 4.0, I thought I’d post a message to share my pain and the solution! It appears that in CRM 4.0 Microsoft have made a change to the way in which the standard reports retrieve the name of the user running the report. I have been unable to find any documentation about this. If you have a custom report that is based on a standard CRM 3.0 report (i.e. it has the CRM_FullName parameter & UserInfo dataset) and upload it into CRM 4.0 then try to run it, you may get either of the following behaviours • Th...

How to create multiple subfolders using VBA
Hello and thanks for reading my question. I need some VBA programming help. I have a main folder with subfolders in it. I want to add a new subfolder to each subfolder in the directory. It would look something like this Main Folder Subfolder1 NewSubfolder Subfolder2 NewSubfolder Subfolder3 NewSubfolder Subfolder4 NewSubfolder I was able to use this VBA to do it for one folder, but I need it to look through all Subfolders MkDir ("C:\MainFolder\Subfolder1\Subfolder1.1") How do I look through each subfolder and add a new subfolder under each...

default user name and password for RMSsample database
Hello, I just installed RMS Store operations 2.0 on a Vista computer. It installed SQL 2005. now I am trying to open the sample database to start a new one. I don't know what is the password for the "sa" user. In version 1.3 with MSDE 2000 the "sa" password was blank. I setup a user and password when I was installing RMS, but that is not working either. thanks for your help bob Hi Bob, Send me an email and I will send you a utility to set SA password. Afshin Alikhani - [ afshin@retailrealm.co.uk ] CEO - Retail Realm = = = = = = = = = = = "Bob Dahdaleh&qu...

non vba way to print non continuous ranges
Hi, Is there a non vba way to print non continous ranges on the one shee using excel? Specifically, lets say I want to print data from columns A, B, C, G an K down to row 35 in each column. Is there a way I can do that withou manually making them continuous by cutting and pasting each range ont a new sheet? Regards, David Obei -- DavidObei ----------------------------------------------------------------------- DavidObeid's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=223 View this thread: http://www.excelforum.com/showthread.php?threadid=27196 You can h...

Re: VBA coding
Reply meant for another post -- Don Guillett SalesAid Software donaldb@281.com "Don Guillett" <donaldb@281.com> wrote in message news:... > right click on sheet tab>view code>insert this>save. > Now, when you enter anything in column F (6) a row will be inserted > > Private Sub Worksheet_Change(ByVal Target As Range) > If Target.Column = 6 Then Target.EntireRow.Insert > End Sub > > > -- > Don Guillett > SalesAid Software > donaldb@281.com > "Nadeem Shafiullah" <nadeem57@telus.net> wrote in message > news:%23k...

How to revert customisations back to default
Hi, I did a proof-of-concept on a CRM install and exported all the customisations. We then decided to deploy and rebuilt the RCM machine from bare metal. When I applied customisations some went through, but not others. I have tried with some success manually editing the XML file to isolate fault, but now just want to revert the install to its out-the-box configuration. Is this possible, and if so how? Thanks, Alex Did you make backups of the initial databases. You then can restore them and after this operation publish the customizations so they will be default again. Succes! &qu...

How to output bitmaps to a printer
Hello, How can I output graphics info like bitmap or jpg files (i.e. logos) on a printer device? I intended to use to CDC::BitBlt() function like the following code: void MyView::OnDraw(CDC* pDC) { CDC* dc = pDC; CBitmap myBitmap; myBitmap.LoadBitmap(IDB_BITMAP1); BITMAP bm; myBitmap.GetBitmap(&bm); // get information (size) of bitmap myBitmap.SetBitmapDimension(bm.bmWidth, bm.bmHeight); CBitmap* pbmOld = NULL; CDC dcMem; dcMem.CreateCompatibleDC(dc); int devCaps = pDC->GetDeviceCaps(RASTERCAPS); if (devCaps & RC_BITBLT) // check if device is capable of ra...

Default Filter Unavailable
When attempting to run reports in CRM, I am receiving the following error message. ERROR: This report cannot have a default filter ...

Using Access form to assign values of variables in an Excel VBA program
I have created a VBA program for Ms Excel.But,to get desired results, every time, I go into the code to change the values of variables.Is there a way to get the values of variables stored in an Access table? YOu need to do a search for ADO method (ActiveX Data Object). There are plenty of example of code on the web. You need to add two references in your VBA to use the method. from VBA menu tools - References 1) Microsoft Access XX.X object library 2) Microsfot ActiveX Data Objects X.X library Use the latest versio of the two libraries on your PC. You will make a conn...

Daily Market Technical Report for: Thursday (October 15, 2009): The Afternoon Newspaper
NSE India : S&P CNX Nifty (Based on the activity of the previous trading day) By Dominic Rebello Review of the Previous day: The Nifty rose substantially on Wednesday (October 14, 2009) a net 63.95 points (1.27%) and closed at 5118 point level. The market opened up and continued so until 14:39 hours when it reached its day high at 5127 points. Then it turned into a range bound movement until closing at the day. The market moved in a range of 73 points. The index remained above its previous close throughout the day. Sentiment was bullish and amongst the 50 Nifty stocks, 35 were gainers a...

[ODBC Driver Manager] Data source name not found and no default dr
Please Help… I have a button on a unbound form, that fires a macro to run the code below… however… I keep getting [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified I believe I have everything as far as Access installed correctly… Is there a problem with my code? Public Function Update_Assign() As String 'Error Handling On Error GoTo Err_Update_Assign_Click 'Establish Dim allRecords As ADODB.Recordset Dim cnCh5 As ADODB.Connection Dim strConnection As String Dim cmdCommand As ADODB.Command Set cmdCommand = New ADODB.Command Dim M...

Function VBA
Dear expert, I am not good at function VBA, but I know that can help me to save a lot of memory. Say a cell in K10, L10 and M10 Contain figures 7,8,10 How can I write a function say in J10 type =cross(K10,L10,M10) Outcome can be 4. If And(M10>L10, L10>K10) = Show "All DOWN" If And(K10>L10, L10>M10) = Show "All UP" If And(K10>L10, L10<M10) = Show "K cross L UP" If And(K10<L10, L10>M10) = Show "K cross L down" Now I have a lengthy function in J10 which is going to copy from J10 to J32000 =IF(AND(K10>L10,L10&g...

Multiple companies / 1 report dictionary / 3 different check stubs
We currently use a modified "Direct Deposit Statement of Earnings" and Employee Checks Stub on Top and Bottom - L" reports to print paychecks/direct deposit statements. We need 3 versions of this modified report because we have three different companies and the checks require 3 different signatures. Other than the different signatures, the report layouts are identical. We use one reports dictionary for all three companies. How best to achieve this? Best regards, Caroline This is what I would try. You have one format for a check and you can export it out from tool...

Assigning a default value to a lookup.
I have a client that only has one unit of measure (Each) and would like to have this value set at default when creating new quote and opportunity products. I spent some time looking into this and have not determined how to control lookups at all except clearing them. Any suggestions would be appreciated. Thanks, Wayne. Hi Wayne, It's documented in the CRM SDK: http://msdn2.microsoft.com/en-us/library/aa681853.aspx -- Michael H�hne, Microsoft Dynamics CRM MVP Web: http://www.stunnware.com/crm2 Feed: http://www.stunnware.com/crm2/atom.aspx Custom Lookup Dialog: http://www.stunnw...

Received Not Invoiced Report
Hi, I entered a few Receiving Shipment transactions without a Purchase Order. These Receiving transactions had landed cost entered. Now i havent entered the Purchasing Invoices for these landed costs and so they show up on the Received Not Invoiced Report. Another AP person entered the landed cost invoices from the Payables Transaction Entry and now i want to get rid of the landed cost invoices from the Received Not Invoice report, how do i go about doing that? Please help. Thnx Dev ...

Stephan Lebans Report to PDF
Following a recommendation on the Acces World Forums http://www.access-programmers.co.uk/forums/index.php I am trying to use the application from Stephan Lebans site called A2000ReportToPDF http://www.lebans.com/reporttopdf.htm to save some reports in PDF format. I like the streamlined way this produces the PDF forms, however I am wondering if there is a way to use this to manage filtered reports? Dave A GoogleGroups search yields several relevant threads. http://groups.google.ca/groups/search?hl=en&lr=&ie=UTF-8&safe=images&num=30&q=lebans+pdf+filter&safe=image...

monthly report problem??
Dear All now i have a database for car parking ,i need to make a monthly report for every customer the problem is as following assume CustName InDate OutDate test 10 March 2007 10 May 2007 i need to know the monthly report for customer test for april 2007 (how many days he park in the parking) now if i query that Indate or Outdate in between 1-april-2007 And 30-April- 2007 the result will be nothing ,although he parked 30 days in april (the whole month) how to solve such problem IF you are doing this report for exactly one month at...

Trend WFBS Scheduled Reports
Just upgraded Trend WFBS5.1 to 6.0 on our SBS2003 box. All went well except that scheduled reports nolonger seem to get sent by email. They run fine just don't get emailed. Has anyone else noticed this? Nick Hi Nick, I have noticed the same thing, although I haven't gotten around to figuring out why "Nick" wrote: > Just upgraded Trend WFBS5.1 to 6.0 on our SBS2003 box. All went well except > that scheduled reports nolonger seem to get sent by email. They run fine > just don't get emailed. Has anyone else noticed this? > > ...

Capital gains Report #2
I have used Microsoft Money for years so am not a novice user. Lately I've done some day trading and noticed to my annoyance that when I run the Reports/Taxes/Capital Gains from the Microsoft Money menu, it gives me incorrect values under the 'Purchase Cost' column. Sale Proceeds are correct. Consequently the overall Capital gains is also wrong. Further, I notice that this happens ONLY to stocks for which dividends have been paid to me in one of my 4 or so accounts at ANY time in the past. It doesn't even have to be the account in which the day trading occurred. I can...