Showing posts with label aspx. Show all posts
Showing posts with label aspx. Show all posts

Tuesday, March 27, 2012

Can I find the default printer

I have successfully modified the routines from here http://msdn2.microsoft.com/en-us/library/ms252091(VS.80).aspx and can print OK on the Development machine but I have had to code the default printer name

I want to be able to get the users default printer and also set the orientation I don't know if this is possible in ASP

I have been able to get the default printer but cannot change the orientation any ideas?

To Get and Set the default Printer works OK
PrintDocument printDoc =newPrintDocument();
string printerName = printDoc.PrinterSettings.PrinterName;//Get the name
printDoc.PrinterSettings.PrinterName = printerName;//use the name

This below does not seem to work??
printDoc.PrinterSettings.DefaultPageSettings.Landscape =true;

|||

HI,jnc:

Try to change this line :

printDoc.PrinterSettings.DefaultPageSettings.Landscape =true;

To this:

printDoc.DefaultPageSettings.Landscape =true;

If i misunderstand you about your question, please feel free to correct me and i will try to help you with more information.

I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be of assistance

|||

Perfect timing, I was just revisiting this and your solution worked fine

Thursday, March 8, 2012

Can connect to sqlexpress via asp.net but not via asp

I can connect to a sqlexpress database using aspx (asp.net 2.0) pages
but not via classic asp pages. Both the asp and aspx pages are within
the same website. The sqlexpress database is also on the same server.
I have tried using a variety of connection strings within my asp pages,
including dsn, dsn-less, windows authentication, sql authentication
etc. (The sql express database by the way has mixed authenatication and
both work fine)
The errors I am getting are the following:
1. When I put a windows authentication string in my asp
page I get this error:
************
Provider error '80040e21'
Multiple-step OLE DB operation generated errors. Check
each OLE DB status value, if available. No work was done.
?, line 0
***************
2. When I use a sql authenticaion string, I get this
error:
********************
Microsoft OLE DB Provider for ODBC Drivers
error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified
?, line 0
**********************
3. When I use a DSN connection string (with the DSN
connecting successfully within the ODBC utility) I get
this error:
******************
Microsoft OLE DB Provider for ODBC Drivers
error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot
open database "xxxx" requested by the login. The login
failed.
?, line 0
***********************
As mentioned before I have no problems in connecting to
the database via aspx pages within the same website. I can also
successfully connect to the database via visual web developer or sql
express manager on the same machine.
Any ideas?
Sorry, solved this!
|||You took the time to post that you found an answer, could you possibly post the solution?
~Another Steve

Quote:

Originally posted by Steve
Sorry, solved this!

Can connect to sqlexpress via asp.net but not via asp

I can connect to a sqlexpress database using aspx (asp.net 2.0) pages
but not via classic asp pages. Both the asp and aspx pages are within
the same website. The sqlexpress database is also on the same server.
I have tried using a variety of connection strings within my asp pages,
including dsn, dsn-less, windows authentication, sql authentication
etc. (The sql express database by the way has mixed authenatication and
both work fine)
The errors I am getting are the following:
1. When I put a windows authentication string in my asp
page I get this error:
************
Provider error '80040e21'
Multiple-step OLE DB operation generated errors. Check
each OLE DB status value, if available. No work was done.
?, line 0
***************
2. When I use a sql authenticaion string, I get this
error:
********************
Microsoft OLE DB Provider for ODBC Drivers
error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified
?, line 0
**********************
3. When I use a DSN connection string (with the DSN
connecting successfully within the ODBC utility) I get
this error:
******************
Microsoft OLE DB Provider for ODBC Drivers
error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot
open database "xxxx" requested by the login. The login
failed.
?, line 0
***********************
As mentioned before I have no problems in connecting to
the database via aspx pages within the same website. I can also
successfully connect to the database via visual web developer or sql
express manager on the same machine.
Any ideas?Sorry, solved this!|||You took the time to post that you found an answer, could you possibly
post the solution?
~Another Steve
Steve wrote:
> *Sorry, solved this! *
larmores
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message1889178.html

Friday, February 24, 2012

Can any help with getting me started with Analysis Services?

I am a newbie to AS. I am trying to follow the simple tutorial http://msdn2.microsoft.com/en-us/library/ms170400.aspx to get started.

However, I do not see an AdventureWorks DW in my SQL Server Management Studio. I have an AdventureWorksDW (all in one word) but not AdventureWorks DW ( in two words).

I was searching to find how to get the AdventureWorks DW database installed and found http://www.ssw.com.au/ssw/KB/KB.aspx?KBID=Q1286726. Followed its instructions but still there is no AdventureWorks DW though the process went OK.

Am I missing something? I ran <drive>:\Program Files\Microsoft SQL Server\90\Tools\Samples\ and double-click SqlServerSamples.msi and still do not have AdventureWorks DW (standard edition or enterprise edition).

I am running SQL Server 2005 with SP2 on Windows XP developer edition.

Thank you much in advance.

Yep you are missing the database download and installation and you need to attach it in managment studio. So in the link below download AdventureWorksDB x86 CI(case insensitive) and AdventureWorks BI CI that is the datawarehouse version. You also need Reporting services installed to view the reports for that IIS is required. Hope this helps.

http://www.microsoft.com/downloads/details.aspx?familyid=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en

|||

Thanks, Caddre. I ran the .msi you pointed out and the deployment of the solutions seemed to work better. I am still confused as to whether or not AdventureWorksDW and AdventureWorks DW Standard Edition are two separate and distinct databases?

The documentation mentions:

The OLAP database (Adventure Works DW) cannot be installed unless the data warehouse (AdventureWorksDW) database is selected for installation. The analysis services project, Adventure Works DW must be deployed before the Adventure Works DW analysis services database can be accessed.

Does Adventure Works DW( in my case it is Standard Edition) show in SQL Server Management Studio? If yes, I still don't see it.

Thanks

|||

Nothing have changed since I last used that database in 2005 it is a Datawarehouse database so it comes with 26 tables it is in Management Studio if you attached it, yes you must attach it before it will show up in your Management Studio. So now go to the location below and verify the MDF and LDF files then go to Management Studio and attach the database. To use those samples after you atttach the database go back to the SQL Server folder location below and click the solution file and VS will open the whole solution for you. SQL Server edition is not relevant. Hope this helps.

Location of MDF and LDF

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL

Location of Samples

C:\Program Files\Microsoft SQL Server\90

|||

Greetings Caddre,

My error... I finally realized that I could view the AdventureWorks DW Standard edition by connecting to Analysis Server (instead of Database engine). It shows in SQL Server Management Studion when I connect to Analysis Server.

In AdventureWorks DW Standard edition , I have data source, data source view, cubes, dimensions, mining structures, roles and assemblies( no tables).

Anyway, thank you for getting me on the right track!

Friday, February 10, 2012

Calling the same report in a batch (rs2005) from aspx page

Hi,
what would be the best way to call the same report with diffrent
parameters.
right now I am calling the RenderInvoice which is called in a loop
(view code below)
is there a better way to do this, like a batch process?
this works, and it does 50 reports in about one minute, I wonder if I
can make it go faster.
or it's just an issue of computer hardware.
Thanks.
protected Byte[] RenderInvoice(ReportExecutionService rs,string
shipmentId)
{
ParameterValue[] parameters = new ParameterValue[2];
parameters[0] = new ReportExecutionWS.ParameterValue();
parameters[0].Name = "ShipmentId";
parameters[0].Value = shipmentId;
parameters[1] = new ReportExecutionWS.ParameterValue();
parameters[1].Name = "ShowLogo";
parameters[1].Value = "True";
// set report parameters
rs.SetExecutionParameters(parameters, "en-us");
// set rendering info
Byte[] result = null;
String format = "PDF";
String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
DeviceInfo>";
String extension = "";
String encoding = "";
String mimeType = "";
Warning[] warnings = null;
string[] streamIDs = null;
result = rs.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
return result;
}You are running the reports one after another. A minute for 50 reports
sounds pretty good to me. RS could do these in parallel but your app would
need to do request the rendering asynchronously. My suggestion is to leave
it alone. I don't think a whole lot of complexity to speed it up more is
worth the effort.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<rperetz@.gmail.com> wrote in message
news:1182807919.166551.199320@.g4g2000hsf.googlegroups.com...
> Hi,
> what would be the best way to call the same report with diffrent
> parameters.
> right now I am calling the RenderInvoice which is called in a loop
> (view code below)
> is there a better way to do this, like a batch process?
> this works, and it does 50 reports in about one minute, I wonder if I
> can make it go faster.
> or it's just an issue of computer hardware.
> Thanks.
>
> protected Byte[] RenderInvoice(ReportExecutionService rs,string
> shipmentId)
> {
> ParameterValue[] parameters = new ParameterValue[2];
> parameters[0] = new ReportExecutionWS.ParameterValue();
> parameters[0].Name = "ShipmentId";
> parameters[0].Value = shipmentId;
> parameters[1] = new ReportExecutionWS.ParameterValue();
> parameters[1].Name = "ShowLogo";
> parameters[1].Value = "True";
> // set report parameters
> rs.SetExecutionParameters(parameters, "en-us");
> // set rendering info
> Byte[] result = null;
> String format = "PDF";
> String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
> DeviceInfo>";
> String extension = "";
> String encoding = "";
> String mimeType = "";
> Warning[] warnings = null;
> string[] streamIDs = null;
>
> result = rs.Render(format, devInfo, out extension, out
> encoding, out mimeType, out warnings, out streamIDs);
> return result;
> }
>