Solved

Removing Connections from "My Connections"

Posted on 2012-03-09
7
546 Views
Last Modified: 2012-03-20
I have recently installed Visual Studio 2010 Professional and am working on getting a Crystal Reports site deployed using several hundred of our existing reports. I have a system DSN set up on my development machine as well as on the IIS server called 'Ross_Data'. Somewhere, somehow, someone has created reports using the DSN on their machine in all caps 'ROSS_DATA'. In my VS website, under My Connections, I have Ross_Data and ROSS_DATA. How do I completely remove the incorrect one - ROSS_DATA? When I look at "My Connections" I see them both. I can right click and remove Ross_Data, but that's the one I want to keep. Right clicking the incorrect one doesn't give me the option to delete it and I can't find any way or anywhere to edit it. I have several reports that won't open in CrystalReportsViewer- I think because they keep trying to open using ROSS_DATA instead of Ross_Data.
0
Comment
Question by:Hers2keep
  • 5
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 37703345
I don't know of a way to remove one.

Were the reports that don't open, developed on your machine or by someone else?
Can you open the reports in Crystal and change the data source?

mlmcc
0
 

Author Comment

by:Hers2keep
ID: 37703382
I can open them in CR in VS2010 and change the datasource, but as soon as I try to run it again, it automatically is picking the incorrect one. Occasionally it's even adding another one, i.e. Ross_Data_1. This is very bizarre. I'm still digging...
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37703545
I haven't seen that problem.

mlmcc
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Hers2keep
ID: 37703564
Leave it to me! I've got several reports that I'm using to get my coding correct before I start creating all the aspx pages for these reports. Every single report that we have on that server uses the same exact DSN - Ross_Data. I've gotten 2-3 different aspx pages created based on existing reports that have no subreports. Some work and some don't. I'm opening the reports themselves in CR2010/VS and saving them in the new format, but it's just not working on all of them. Literally I've copied the code from a working aspx page and pasted it on another and ONLY changed the name of the crystal report and it doesn't always work. I've got another one that actually has a filter set on the aspx page and it works perfectly fine and refreshes anytime the selection changes. I've been looking for a good book to get on VS2010 and/or Crystal Reports 2010 and/or C#. Do you have any suggestions?
0
 

Author Comment

by:Hers2keep
ID: 37703617
For instance, this report takes the value selected in a DropDownList and pulls up the report only for that particular warehouse. This code works.

    private void ConfigureCrystalReports()
    {
        if (!IsPostBack)
        {
            crystalReportViewer.Visible = false;
        }

        string reportPath = ("~/customreports/CURRINV_GL_NOLOT_PROD.rpt");

        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.ServerName = "Ross_Data";
        connectionInfo.DatabaseName = "fin_prod";
        connectionInfo.UserID = "xxx";
        connectionInfo.Password = "xxx";
        crystalReportViewer.ReportSource = reportPath;

        SetDBLogonForReport(connectionInfo);

    }

    protected void ddlWarehouse_SelectedIndexChanged(object sender, EventArgs e)
    {
        string warehouse = ddlWarehouse.SelectedValue;
        string selectFormula = "{VW_CURRENT_INVENTORY_GL.WH}=" + "'" + warehouse + "'";
        crystalReportViewer.SelectionFormula = selectFormula;
        crystalReportViewer.Visible = true;
        crystalReportViewer.DataBind();
    }


        private void Page_Init(object sender, EventArgs e)
    {
        ConfigureCrystalReports();
    }

    private void SetDBLogonForReport(ConnectionInfo connectionInfo)
    {
        TableLogOnInfos tableLogOnInfos = crystalReportViewer.LogOnInfo;
        foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
        {
            tableLogOnInfo.ConnectionInfo = connectionInfo;
        }
    }

Open in new window


The report refreshes correctly anytime you change the value in the DropDownList. So, I copied the code into a new aspx page for another report that gets filtered by the value entered into a textbox. This code does not work - stops at the screen asking for the server/user/password.

    private void ConfigureCrystalReports()
    {
        if (!IsPostBack)
        {
            crystalReportViewer.Visible = false;
        }

        string reportPath = ("~/customreports/BillOfLading2.rpt");

        ConnectionInfo connectionInfo = new ConnectionInfo();
        connectionInfo.ServerName = "Ross_Data";
        connectionInfo.DatabaseName = "fin_prod";
        connectionInfo.UserID = "xxx";
        connectionInfo.Password = "xxx";
        crystalReportViewer.ReportSource = reportPath;

        SetDBLogonForReport(connectionInfo);
    }

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string bol = txtbol.Text;
        string selectFormula = "{VW_BOL_DESPATCH_HEADER.DESPATCH_NOTE_TEXT}=" + "'" + bol + "'";
        crystalReportViewer.SelectionFormula = selectFormula;
        crystalReportViewer.DataBind();
        crystalReportViewer.Visible = true;
    }

    private void Page_Init(object sender, EventArgs e)
    {
        ConfigureCrystalReports();
    }

    private void SetDBLogonForReport(ConnectionInfo connectionInfo)
    {
        TableLogOnInfos tableLogOnInfos = crystalReportViewer.LogOnInfo;
        foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
        {
            tableLogOnInfo.ConnectionInfo = connectionInfo;
        }
    }

Open in new window


And the *really* weird thing is the first set of code, the one that works, actually has a subreport at the end of the report and it loads just fine and I don't even have the logon information set up for subreports yet (at least that works anyway).

I've opened both reports in CR2010 and saved them.
0
 

Accepted Solution

by:
Hers2keep earned 0 total points
ID: 37726384
I got around this problem by connecting through ado.net instead of the odbc connections.
0
 

Author Closing Comment

by:Hers2keep
ID: 37741250
This was the only way I could resolve the connection problem.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question