被呼叫方拒绝接收呼叫。 (异常来自 HRESULT:0x80010001 (RPC_E_CALL_REJECTED))

cunzhangok 2008-12-13 02:34:23
到网上找了很多的资料就是解决不了,希望高手解决下

如题,就是在将数据库里面的数据导入到word中的时候出现的。为什么?

如果可以解决的话,我加分500分!绝对守信!
...全文
7854 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
SqlDataAdapter 2012-07-31
  • 打赏
  • 举报
回复
我也遇到此问题了
zh_qlong 2012-07-05
  • 打赏
  • 举报
回复
也遇到同样的问题,试试楼主的方法!先谢谢!
蓝域D公主 2011-04-11
  • 打赏
  • 举报
回复
方法一:延时
Catch ex As Exception
System.Threading.Thread.Sleep(1000)

方法二:
在给策略类赋值前,先select一下,保证当前cell处于active
jiu9gm 2011-03-01
  • 打赏
  • 举报
回复
同样的问题!未解决~~~~~~
+1
hunya_2353 2010-12-14
  • 打赏
  • 举报
回复
同样的问题!未解决~~~~~~
jiejiep 2010-05-06
  • 打赏
  • 举报
回复
楼主,我的问题和你一样,但是为什么不能解决呢,我的情况是,数据少的时候导出没有问题,但数据到了一定程度以后就会有这样的错误提示,你说的办法我都用了,但仍然没用。。。。
qualylee 2009-06-04
  • 打赏
  • 举报
回复
cunzhangok 2008-12-13
  • 打赏
  • 举报
回复
迫于压力:我自己解决了!!!望给各位带来帮助!!!

被呼叫方拒绝接收呼叫 或者 消息筛选器显示应用程序正在使用中。
解决方案:


在运行里面输入:
dcomcnfg

在“服务”里找到这三个服务,都去启动

Distributed Transaction Coordinator

Remote Procedure Call (RPC)

Security Accounts Manager

如果:Distributed Transaction Coordinator 启动不了
就先在运行里面输入:
msdtc -resetlog

然后在开启:Distributed Transaction Coordinator


接着关闭服务组件窗体 ,并重新打开,这个时候每个组建就有属性了
然后:在命令行中输入:dcomcnfg,会显示出“组件服务”管理器
2、打开“组件服务->计算机->我的电脑->DCOM 配置”,找到“Microsoft Word文档”,单击右键,选择“属性”
在“属性”对话框中单击“标识”选项卡,选择“交互式用户””,关闭“组件服务”管理器。
如果你用的是wps,这里的Microsoft Word文档就是wps文档,操作一样的。

好了问题解决。

yagebu1983 2008-12-13
  • 打赏
  • 举报
回复
你去www.cnblogs.com看看!!
搜word导出
cunzhangok 2008-12-13
  • 打赏
  • 举报
回复
   object Nothing = System.Reflection.Missing.Value;
object missing = System.Reflection.Missing.Value;
//创建Word文档
Word.Application wordApp = new Word.ApplicationClass();

wordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; //重要非常重要!!!!!!否则程序会异常,应为在工作的过程中,默认要用户交互,可是用户确没有交互,所以就出错了
Word.Document wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
wordApp.Visible = false;
wordDoc.Activate();

//设置文档宽度
wordApp.Selection.PageSetup.LeftMargin = wordApp.CentimetersToPoints(float.Parse("2"));
wordApp.ActiveWindow.ActivePane.HorizontalPercentScrolled = 11;
wordApp.Selection.PageSetup.RightMargin = wordApp.CentimetersToPoints(float.Parse("2"));

Object start = Type.Missing;
Object end = Type.Missing;

PictureBox pp = new PictureBox(); //新建一个PictureBox控件

object rng = Type.Missing;
string strInfo = "学生信息";
start = 0;
end = 0;
object lg = strInfo.Length;

wordDoc.Range(ref start, ref end).InsertBefore(strInfo); //插入文本
wordDoc.Range(ref start, ref lg).Font.Name = "Verdana"; //设置字体
wordDoc.Range(ref start, ref lg).Font.Size = 30; //设置字体大小
wordDoc.Range(ref start, ref lg).ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;//设置字体局中
start = strInfo.Length;
end = strInfo.Length;
wordDoc.Range(ref start, ref end).InsertParagraphAfter();//插入回车

object missingValue = Type.Missing;
object location = strInfo.Length;
Word.Range rng2 = wordDoc.Range(ref location, ref location);
int numberlunwen = 0;
int numbergrade = 0;
int numberhome = 0;
int numberstudy = 0;
int numberperson = 12;
//检索数据库看看 几人的信息是几行numberperson 发表的论文的数目记为:numberlunwen 查找个人的受奖励和惩罚的个数:numbergrade 查找家庭成员和社会关系个数numberhome 查找学习和工作记录numberstudy 根据这个记录生成最后的记录的总的个数
int totall = numbergrade + numberhome + numberlunwen + numberperson + numberstudy;
Word.Table table1 = wordDoc.Tables.Add(rng2, 28 + 13, 8, ref missingValue, ref missingValue); //建立一个table 这里应该又什么命令可以将每个格子里面的数据设置格式的但是在网上找的例子不太行
table1.Rows.HeightRule = Word.WdRowHeightRule.wdRowHeightAtLeast;
table1.Rows.Height = wordApp.CentimetersToPoints(float.Parse("1.2"));
table1.Range.Font.Size = 10;
table1.Range.Font.Name = "宋体";

//设置表格样式
table1.Borders.Item(Word.WdBorderType.wdBorderTop).LineStyle = Word.WdLineStyle.wdLineStyleSingle;
table1.Borders.Item(Word.WdBorderType.wdBorderTop).LineWidth = Word.WdLineWidth.wdLineWidth050pt;
table1.Borders.Item(Word.WdBorderType.wdBorderTop).Color = Word.WdColor.wdColorAutomatic;
table1.Borders.Item(Word.WdBorderType.wdBorderLeft).LineStyle = Word.WdLineStyle.wdLineStyleSingle;
table1.Borders.Item(Word.WdBorderType.wdBorderLeft).LineWidth = Word.WdLineWidth.wdLineWidth050pt;
table1.Borders.Item(Word.WdBorderType.wdBorderLeft).Color = Word.WdColor.wdColorAutomatic;
table1.Borders.Item(Word.WdBorderType.wdBorderHorizontal).LineStyle = Word.WdLineStyle.wdLineStyleSingle;
table1.Borders.Item(Word.WdBorderType.wdBorderVertical).LineStyle = Word.WdLineStyle.wdLineStyleSingle;
table1.Borders.Item(Word.WdBorderType.wdBorderHorizontal).LineWidth = Word.WdLineWidth.wdLineWidth050pt;
table1.Borders.Item(Word.WdBorderType.wdBorderHorizontal).Color = Word.WdColor.wdColorAutomatic;
table1.Borders.Item(Word.WdBorderType.wdBorderVertical).LineWidth = Word.WdLineWidth.wdLineWidth050pt;
table1.Borders.Item(Word.WdBorderType.wdBorderVertical).Color = Word.WdColor.wdColorAutomatic;
table1.Borders.Item(Word.WdBorderType.wdBorderBottom).LineStyle = Word.WdLineStyle.wdLineStyleSingle;
table1.Borders.Item(Word.WdBorderType.wdBorderBottom).LineWidth = Word.WdLineWidth.wdLineWidth050pt;


wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;//设置中对其


//下面是用户的基本信息

//第1行显示
table1.Cell(1, 7).Merge(table1.Cell(4, 8));
table1.Cell(1, 1).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 2).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 3).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 4).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 5).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 6).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(1, 1).Range.Text = "姓名";
table1.Cell(1, 2).Range.Text = "数据库姓名";
table1.Cell(1, 3).Range.Text = "性别";
table1.Cell(1, 4).Range.Text = "数据库性别";
table1.Cell(1, 5).Range.Text = "出生日期";
table1.Cell(1, 6).Range.Text = "数据库出生日期";
//第2行显示


table1.Cell(2, 2).Merge(table1.Cell(2, 4));
table1.Cell(2, 1).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(2, 2).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(2, 3).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(2, 4).VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;
table1.Cell(2, 1).Range.Text = "证件号码";
table1.Cell(2, 2).Range.Text = "数据库证件号码";
table1.Cell(2, 3).Range.Text = "政治面貌";
table1.Cell(2, 4).Range.Text = "数据库政治面貌";

我有747分,绝对守信!!!
loworth 2008-12-13
  • 打赏
  • 举报
回复
具体是用什么样的过程去实现导出的。





如果可以解决的话,我加分500分!绝对守信!
# cunzhangok
#
# 等级:
# 可用分等级:贫农
# 总技术分:27
# 总技术分排名:165433
# 结帖率:74.07%

111,109

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧