Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 20th, 2006, 03:27 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default The request could not be submitted for background

I have a problem with CR for VS 2005.

Before view the report, i change in runtime the images in the report with another image in my PC and the error is :

Error in File C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\CrystalReport {850CE782-3783-4DE9-A935-38C57A8955B3}.rpt:
The request could not be submitted for background processing.

and the code is:

//begin

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;


public partial class _Default : System.Web.UI.Page
{
    private ReportDocument oRpt;

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public ReportDocument ORpt
    {
        get { return oRpt; }
        set { oRpt = value; }
    }

    private void Exportar(string formato)
    {
        System.IO.Stream rptStream = this.ORpt.ExportToStream(CrystalDecisions.Shared.E xportFormatType.PortableDocFormat);
        string contentType = "application/pdf";

        if (formato == "WORD")
        {
            rptStream = this.ORpt.ExportToStream(CrystalDecisions.Shared.E xportFormatType.WordForWindows);
            contentType = "application/msword";
        }
        if (formato == "EXCEL")
        {
            rptStream = this.ORpt.ExportToStream(CrystalDecisions.Shared.E xportFormatType.Excel);
            contentType = "application/vnd.ms-excel";
        }

        this.ORpt.Close();

        System.IO.BinaryReader br = new System.IO.BinaryReader(rptStream);
        byte[] dataBytes = new byte[rptStream.Length];
        for (int i = 0; i < rptStream.Length; ++i)
            dataBytes[i] = br.ReadByte();
        Response.ClearContent();
        Response.ClearHeaders();
        Response.ContentType = contentType;
        Response.BinaryWrite(dataBytes);
        Response.Flush();
        Response.Close();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand command;
        SqlParameter sqlParam;
        string param;

        string cnnString = ConfigurationManager.AppSettings["connectionstring"];
        SqlConnection connection = new SqlConnection(cnnString);
        connection.Open();
        command = new SqlCommand();
        command.CommandText = "SELECT top 10 trademark, appno, digital, id FROM BulletinTrademarks ";
        command.CommandType = CommandType.Text;
        command.Connection = connection;

        SqlDataAdapter dataAdapter = new SqlDataAdapter(command);
        DataSet dataSet = new DataSet();

        dataAdapter.Fill(dataSet, "BulletinTrademarks");
        this.ArmarLogos(dataSet, true);
        this.ORpt = new ReportDocument();
        this.ORpt.FileName = ConfigurationManager.AppSettings["reportspath"] + "CrystalReport.rpt";
        this.ORpt.SetDataSource(dataSet);

        this.Exportar("PDF");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        this.Response.Redirect("viewer.aspx");
    }

    public void ArmarLogos(DataSet ds, bool logotipo)
    {
        if (logotipo)
        {
            string ubicacion = "G:\\NET\\visual studio 2005\\WebSites\\WebSiteImageTest\\";
            foreach (DataRow dr in ds.Tables["BulletinTrademarks"].Rows)
            {
                string archivo = ubicacion + "97_000084.jpg";
                if (!File.Exists(archivo))
                    archivo = ubicacion + "px.jpg";
                try
                {
                    FileStream fs = new FileStream(archivo, FileMode.Open); // create a file stream
                    BinaryReader br = new BinaryReader(fs);

                    //dr[33] = br.ReadBytes((int)br.BaseStream.Length);
                    dr[2] = br.ReadBytes((int)br.BaseStream.Length);

                    fs.Close();
                    br = null;
                    fs = null;
                }
                catch (Exception ex)
                {
                    string a = ex.Message;
                }
            }
        }
    }
}


//end

Even in a viewer it doesn't work.

and I installed SP3 & SP4 and the hotfix
- cr10win_en.zip
- common10win_en.zip

Somebody can help me, please
 
Old July 3rd, 2006, 02:57 PM
Authorized User
 
Join Date: Dec 2004
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

even i have the same prob. the report some time for soem data give this error and again it works fine today for the same data set.
any reason why.
Thanks,
Kavitha.
 
Old November 1st, 2006, 08:20 PM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I encountered this error for the first time yesterday. It was also
somewhat intermitent.

Turns out that the formula used for grouping in the report in
question concatenated names + address fields...and the address
fields had recently been increased in size. Someplace between
250 and 300 characters, there seems to be a strnig length where
trying to use it for a grouping causes this error. When I forced
it to truncate to 250 characters, the error disappeared.






Similar Threads
Thread Thread Starter Forum Replies Last Post
request could not be submtted for background proce polofson BOOK: Professional Crystal Reports for VS.NET 11 May 20th, 2013 06:35 AM
request forwarging & request redirection hafizmuhammadmushtaq Servlets 2 April 24th, 2008 12:42 AM
The request could not be submitted for background thlaing Crystal Reports 1 July 3rd, 2006 03:01 PM
Error in File:The request could not be submitted JMak15 Crystal Reports 2 February 3rd, 2005 11:19 AM
Crystal - not submitted for background processing DTCT Crystal Reports 0 November 2nd, 2004 02:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.